home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 015a / dosimp10.zip / SIMPLY2.HYP < prev    next >
Text File  |  1991-08-12  |  118KB  |  1,999 lines

  1.                            The |tEDLIN|t Line Editor
  2.  
  3. An awful lot of people go around these days saying that |nEDLIN|n is a lou-
  4. sy rotten piece of junk.  Well, ok, it's a pretty sad excuse for a text
  5. editor, but until you get something better, |nEDLIN|n will work just fine.
  6. It's free with DOS, after all.  And it's not a bit hard to learn, like
  7. everybody says it is.  (If you have DOS version 5, use EDIT instead.)
  8.  
  9. It's called a line editor because it works with one line of text at a
  10. time.  So it displays files with line numbers next to each line, and
  11. these are the numbers you use to work with the lines.
  12.  
  13. The syntax of the command is really simple.  You just type the command
  14. followed by the name of the file you want to edit or create.  If the file
  15. is not in the current directory, you specify the |spath|sname as well as the
  16. filename.  For example,
  17.           |nEDLIN|n C:\AUTOEXEC.BAT
  18.  
  19. |nEDLIN|n is especially good for working with AUTOEXEC.BAT and CONFIG.SYS
  20.                            <page down> for more
  21.                               EDLIN continued
  22. files, because |nEDLIN|n makes 100% ASCII files.  If you were to use a word
  23. processor to create these configuration files, you would have to remember
  24. to save the file in the word processor's version of text, |nASCII|n, or non-
  25. document mode, because word processors insert all sorts of special sym-
  26. bols into the file, to tell it where the margins are, where the words
  27. should be in boldfaced type, things like that.  If you tried to use a
  28. file like that as a DOS file, DOS would just have a fit!  DOS only wants
  29. to deal with plain old straight |nASCII|n text, and that's just what |nEDLIN|n
  30. gives to DOS.
  31.  
  32. When you enter the above command, |nEDLIN|n |nAUTOEXEC.BAT|n, if the file already
  33. exists you will see "End of input file", or if the file does not exist
  34. yet, you will see "New file".  Then you will see |nEDLIN|n's prompt, which is
  35. just an asterisk (*).
  36.  
  37. Another use that |nEDLIN|n has for the asterisk is to mark the |ncurrent|n line.
  38. The |ncurrent|n line is the one that was most recently edited.  When you
  39. first open a file, the |ncurrent|n line is line one.  But after that, most
  40.                            <page down> for more
  41.                               EDLIN continued
  42. commands that you use will change the |ncurrent|n line to the one you per-
  43. formed the command on.  So that line will be the one with the asterisk.
  44.  
  45. Now if you enter a command without any line number, the command will be
  46. performed on the |ncurrent|n line.  Of course it's always safest to include
  47. the line number in the command, but leaving it out and just having it
  48. default to the |ncurrent|n line is a convenient shortcut for after you become
  49. really familiar with |nEDLIN|n.
  50.  
  51. A line in |nEDLIN|n can be as long as 253 characters.  If the text you are
  52. putting on a line reaches the right edge of the screen, it will wrap
  53. around to the next line of the screen, but it is still on the same line
  54. number until you press <Enter> to end the line.
  55.  
  56. There are some special |tediting keys|t that you can use in |nEDLIN|n, and these
  57. same keys can be used in the same way at the DOS command line as well.
  58. The difference is that in |nEDLIN|n, these special keys allow you to bring
  59. down the previous line and make changes to it, and in DOS these keys al-
  60.                            <page down> for more
  61.                               EDLIN continued
  62. low you to edit and re-execute the last command you entered.  You see,
  63. there is a thing called a "template", and in DOS, the template is DOS's
  64. |nmemory|n of the last command you executed.  In |nEDLIN|n, the template is DOS's
  65. |nmemory|n of the last line that you edited, or if you're editing a line now,
  66. then the template is the line that was at that line number before you
  67. started changing it.  Well the editing keys let you work with whatever
  68. is in the template.
  69.  
  70. For example, the <F1> key will place the first character of the previous
  71. line onto the |ncurrent|n line.  Then if you hit the <F1> key again, the sec-
  72. ond character from the previous line will be copied to the |ncurrent|n line.
  73. The <F3> key copies the entire previous line, from the position of the
  74. cursor to the end of the line, to the |ncurrent|n line.  And the <F2> key,
  75. followed by some character, copies all the characters from the previous
  76. line, up until the character that you typed after the <F2> key.  For ex-
  77. ample, suppose you are editing line number 4:
  78.           4: Hello, there.  How are you doing?
  79.           4:*_
  80.                            <page down> for more
  81.                               EDLIN continued
  82. Now if you were to hit the <F1> key five times, here's what you'd get:
  83.           4: Hello, there.  How are you doing?
  84.           4:*Hello_
  85. Then if you hit the <F2> key immediately followed by the <w> key:
  86.           4: Hello, there.  How are you doing?
  87.           4:*Hello, there.  Ho_
  88. And if you hit the <F3> key, you'd get this:
  89.           4: Hello, there.  How are you doing?
  90.           4:*Hello, there.  How are you doing?_
  91. Now suppose you wanted to change that line to "How the heck are you do-
  92. ing?"  First you'd hit <F2> <a> to copy all of the line up to the first
  93. "a" down to the |ncurrent|n line.  Then hit the <Insert> key to toggle the
  94. insert mode on.  Now everything you type will be inserted into the pre-
  95. vious line.  So type "the heck ".  Then if you hit the <F3> key, the
  96. words "are you doing?" will be copied to the |ncurrent|n line.
  97.  
  98. Then suppose you decide you don't want that "the heck" in there after
  99. all.  So edit line four again and hit <F2> <t> <F2> <t>:
  100.                            <page down> for more
  101.                               EDLIN continued
  102.           4: Hello, there.  How the heck are you doing?
  103.           4:*Hello, there.  How _
  104. Now what you want to do is delete the next 8 characters, right?  So just
  105. hit the <Delete> key 8 times, and then <F3> and here's what you've got:
  106.           4: Hello, there.  How the heck are you doing?
  107.           4:*Hello, there.  How are you doing?_
  108.  
  109. Those same keys work the same way from one line number to the next.
  110. Suppose you want to write some lines that look like this:
  111.           5: See page 428 for more information.
  112.           6: See page 486 for more information._
  113. Well, to do that, you first write line number 5 like that, and then when
  114. you get to line 6, just hit <F2> <2> and type <8> <6> and <F3>.
  115.  
  116. Now the <F4> key is also pretty interesting.  It does pretty much the ex-
  117. act opposite of the <F2> key.  You type <F4> and some character key, and
  118. all the characters up until that character you typed get deleted, and the
  119. character you typed becomes the first character in the line, and the rest
  120.                            <page down> for more
  121.                               EDLIN continued
  122. of the line is copied to the |ncurrent|n line as well.  For example:
  123.           4: Hello, there.  How the heck are you doing?
  124.           4:*_
  125. Now if you were to type <F1> <i> <F4> <,>, then you'd end up with this:
  126.           4: Hello, there.  How the heck are you doing?
  127.           4:*Hi, there.  How the heck are you doing?_
  128.  
  129. Ok, we also have the <F5> key.  What that does is to copy the |ncurrent|n
  130. line into the template without executing it.   Without the <F5> key, the
  131. only way to edit the |ncurrent|n line is to backspace over everything you've
  132. already typed, change the little mistake, and then retype the rest of the
  133. line again.  Yuk.  Well with <F5>, you can just put the line you're work-
  134. ing on into the template, and then use the editing keys on it as if it
  135. were the previous line instead of the |ncurrent|n line.  The problem is, you
  136. have to have a good |nmemory|n because as soon as you hit <F5>, the line dis-
  137. appears from the screen.  You have to remember what it said to be able to
  138. edit it without seeing it.  That's only the case at the DOS command line,
  139. though.  In |nEDLIN|n, the line doesn't disappear when you hit <F5>.  Instead
  140.                            <page down> for more
  141.                               EDLIN continued
  142. a little @ symbol appears at the end, and the cursor moves down one line:
  143.           4:*Hello, there.  How the hedk are you doing?@
  144.              _
  145. See where the @ appeared when I hit <F5>?  Now that whole line, except
  146. for the @, is in the template and the cursor dropped down so I could try
  147. again, without the typo.  So if I hit <F2> <d> <c> <F3> then I have this:
  148.           4:*Hello, there.  How the hedk are you doing?@
  149.              Hello, there.  How the heck are you doing?_
  150. Well that works the same way at the DOS command prompt, except that once
  151. you hit <F5> you can't see the line that you're editing like you can in
  152. |nEDLIN|n.
  153.  
  154. Next, there is the <F6> key.  This inserts a ^Z End-of-File character
  155. into whatever you're typing.  The main use you'll ever have for that is
  156. when you're using COPY CON FILENAME to create a little text file without
  157. using |nEDLIN|n or anything.
  158.  
  159. Then there's the <F7> key, which places a null character, ASCII code 0,
  160.                            <page down> for more
  161.                               EDLIN continued
  162. into your text.  This will look like ^@ on the screen when you first type
  163. it, but in general the null character is just a blank.  It's useful for
  164. causing the ECHO command to display a blank line during a batch file.
  165.  
  166. And last but not least, there's the <Esc> key, which will just cancel
  167. the line you were typing and give you a blank line to start over on.
  168.  
  169. Another special key combination that can be useful in |nEDLIN|n, is <Ctrl-V>.
  170. What that does, is to tell |nEDLIN|n that the next character you type should
  171. be considered to be a control character.  For example, if you were to
  172. type <Ctrl-V> followed by the [ character, |nEDLIN|n would put ^[ into the
  173. file, which represents the ESCape character, which is used to get the
  174. attention of the ANSI.SYS device driver, or of your printer.
  175.  
  176. Another type of special character that you can enter into a file with ED-
  177. LIN, is box-drawing characters.  To enter an ASCII character number 206,
  178. which looks like this, ╬, you just hold down the <Alt> key while typing
  179. the numbers 2, 0, and 6 on the numeric keypad, then let go of the <Alt>
  180.                            <page down> for more
  181.                               EDLIN continued
  182. key.  You can use these characters to make some decent-looking boxes and
  183. menus.  For example, the top line of a double box:  ╔════════╦════════╗
  184.  
  185. Since everything you do in |nEDLIN|n depends on the line numbers of the text
  186. lines, remember every time you change something, use the L or P command
  187. to display the file again, to see what the new line numbers are.  Because
  188. whenever a line is inserted or deleted, that changes the line numbers for
  189. all the lines after that point in the file.  If you were to delete what
  190. used to be line number 27, you'd be deleting the wrong line, because
  191. since you inserted some other line before line 27, now what used to be
  192. line 27 is now line 28.  Always remember to redisplay the line numbers
  193. after making any changes, before making any more changes.
  194.  
  195. Ok, here are the most-often-used |nEDLIN|n commands:
  196.  
  197. To edit a line that already exists, just enter its line number as a com-
  198. mand.  |nEDLIN|n will show you the line as it presently exists, and right un-
  199. der that, a blank line with the same line number, which is where you type
  200.                            <page down> for more
  201.                               EDLIN continued
  202. what you now want the line to say.  Hit <Enter> when you're done.  Then
  203. if you also want to edit the very next line, you can just hit <Enter>
  204. again; you don't have to type the next line number first.
  205.  
  206. C (copy)   To make another copy of some range of lines.  If you wanted to
  207. put another copy of lines 4 through 8 right before line 23, the command
  208. to do that would be 4,8,23C.
  209.  
  210. D (delete)   To delete a line or a range of lines.  If you want to delete
  211. the line that has number 6 beside it, the command would be 6D.  If you
  212. wanted to delete lines 6 through 12, the command would be 6,12D.
  213.  
  214. E (end)   This is the command you use when you've got the file all done,
  215. and you want to go back to DOS.  |nEDLIN|n will make a |nbackup|n copy of the
  216. file the way it was before you started editing, and name that file with
  217. the same name, only with a .BAK extension.  Then it will save the file to
  218. disk under the name you called it when you started the |nEDLIN|n command.
  219.  
  220.                            <page down> for more
  221.                               EDLIN continued
  222. I (insert)   This is the command you use to insert any line into a file.
  223. If you've just started creating a brand new file, I is the first command
  224. you want to use.  If you're editing a file that already exists, and you
  225. want to insert a line right before line number 6, then the command would
  226. be 6I.  If you want to add a line to the end of the file, the command
  227. would be #I because the # symbol in |nEDLIN|n always means "the line number
  228. right after the last line number that exists in the file".  To insert a
  229. line right before the |ncurrent|n line, use .I, because the . symbol in |nEDLIN|n
  230. means the |ncurrent|n line.  Or you could just use I because if no line num-
  231. ber is specified, |nEDLIN|n |sdefault|ss to the |ncurrent|n line.  When you're done
  232. inserting lines, you get out of insert mode by using the <Enter> key to
  233. make sure you're on a blank line, then you use the <Ctrl-C> combination.
  234. This will take you back to the * prompt at the left edge of the screen,
  235. where you can use any of the other |nEDLIN|n commands to do some more editing
  236. or to display the file, or whatever you want to do.
  237.  
  238. L (list)   This command is used to display the lines in the file.  If you
  239. want to display lines 8 through 15, the command would be 8,15L.  If you
  240.                            <page down> for more
  241.                               EDLIN continued
  242. leave out the ending line number, and just type 8L, then |nEDLIN|n will dis-
  243. play 23 lines starting with line 8.  What's different between the L com-
  244. mand and the P command, is that use of the L command does not change the
  245. |ncurrent|n line number.  If line 9 was |ncurrent|n before you used the L command
  246. then line 9 will still be |ncurrent|n afterward.
  247.  
  248. M (move)   This command can be used to move a line or a block of lines
  249. from one location to another in a file.  If you want to move the lines 3
  250. through 16, to a position just before line 1, then the command would be
  251. 3,16,1M.  If you only wanted to move line 3 to a position before line 1,
  252. the command would be 3,3,1M.  In that case, line 3 is both the starting
  253. line and the ending line for the block of lines to be moved.
  254.  
  255. P (page)   This command displays 23 lines of the file.  If you use a line
  256. number, as in 5P, then lines 5 through 27 will be displayed.  But if you
  257. leave out the line number, the |ncurrent|n line and the next 22 lines will be
  258. displayed.  When the P command is used, the last line displayed becomes
  259. the |ncurrent|n line.  Therefore, if you immediately give another P command,
  260.                            <page down> for more
  261.                               EDLIN continued
  262. without a line number, the next 23 lines will be displayed automatically.
  263.  
  264. Q (quit)   This is the command to use to exit from |nEDLIN|n without saving
  265. the file.  If you've made a bunch of goofs, just enter Q and the copy of
  266. the file on the disk will remain exactly as if you hadn't edited it at
  267. all.
  268.  
  269. R (replace)   This is the command you use to search-and-replace one
  270. string of text with another.  Suppose you want to change all of the oc-
  271. currences of the word "Michael" between lines 5 and 32 with the word
  272. "Mike".  Here's the command:
  273.           5,32 ? RMichael<F6>Mike
  274. The ? in that command causes |nEDLIN|n to stop and ask you, on each line that
  275. contains the word "Michael", whether you really want to replace it with
  276. "Mike".  If you wanted to change all the occurrences of Mike Jones with
  277. Mike, you could either use 5,32 ? RMike Jones<F6>Mike, or you could use
  278. 5,32 ? R Jones<F6> which would replace " Jones" with "nothing at all".
  279. Notice that the only time you include a <Space> in the search string or
  280.                            <page down> for more
  281.                               EDLIN continued
  282. replace string, is when you want a <Space> to be one of the characters
  283. that gets searched or replaced.  Otherwise, there must never be a <Space>
  284. right after the R command.
  285.  
  286. Whenever you hit the <F6> key, you will see ^Z on your screen.  ^Z means
  287. <Ctrl-Z> and <F6> is a shortcut for <Ctrl-Z>.  So if for some reason you
  288. can't use the <F6> key, like if you have used ANSI.SYS to reassign the
  289. <F6> key to some other string, you can just use <Ctrl-Z> in its place.
  290.  
  291. S (search)   This command will show you every line which contains the
  292. text you want to search for.  If you want to find every occurrence of the
  293. word "Michael" from line 5 through line 32, the command would be:
  294.           5,32 ? SMichael
  295. The ? makes |nEDLIN|n ask you, after displaying each line, if you want to end
  296. the search or not.  If you say Y(es), the line becomes the |ncurrent|n line
  297. and the search ends.  If you hit any key besides <Y>, the search contin-
  298. ues.  If you don't use the ? parameter |nEDLIN|n will only show you the first
  299. occurrence of that text that it finds.  Remember that the search is case
  300.                            <page down> for more
  301.                               EDLIN continued
  302. sensitive, so if you search for Michael, MICHAEL won't be found.
  303.  
  304. T (transfer)   This command will import another ASCII file into the one
  305. you're currently editing.  This file has to be in the current directory,
  306. though it doesn't have to be on the |ncurrent|n drive.  And it really does
  307. have to be a pure |nASCII|n file.  Suppose you have a file named A:HELLO.TXT
  308. and you want to insert it just before line 6 of the file you're editing,
  309.           6TA:HELLO.TXT
  310. will do it.
  311.  
  312. If you enter the |nEDLIN|n command with the /B switch, as in |nEDLIN|n FILE /B,
  313. you can edit all of a file that has an End-of-File character embedded in
  314. it.  (See the section about the COPY command.)  Because the /B, which
  315. stands for Binary, means that |nEDLIN|n will look in the file's |ndirectory|n en-
  316. try to see how long the file is, rather than just editing whatever comes
  317. before the first End-of-File character, which would, by the way, remove
  318. all the text that came after that End-of-File character if you were to
  319. save the file back to disk after not using the /B switch.  Also, |nEDLIN|n
  320. does put the EOF character on the end of every file you edit with it!
  321.                             The |TRESTORE|T Command
  322.  
  323. This is the command that you must use in order to get your files back
  324. from your floppy disks after you've backed them up.  The BACKUP command
  325. puts all the files it backs up into one great big file, so |nRESTORE|n is the
  326. only way you'll ever see those files again, if your hard drive dies.
  327.  
  328. The syntax of the |nRESTORE|n command is like this:
  329.           |nCOMMAND|n SOURCE TARGET SWITCHES
  330. just like most DOS commands.  So let's discuss those parts one at a time.
  331.  
  332. The command is |nRESTORE|n, but like any external command, if the |nRESTORE|n.COM
  333. file is neither in the current directory nor in a |ndirectory|n on your PATH,
  334. then you'll have to specify the entire pathname to the command as part of
  335. the command.  That means you might say C:\DOS\RESTORE instead of |nRESTORE|n.
  336.  
  337. The source is the drive where the files are, that you want to have res-
  338. tored to the hard drive.  Usually just A: or B:.
  339.  
  340.                            <page down> for more
  341.                              RESTORE continued
  342. The target is where you want the files to end up.  If you want to restore
  343. the entire hard drive, then the target would be C:\*.*.  If you want to
  344. restore only the files that start with BR in the \BROWN subdirectory, the
  345. target would be C:\BROWN\BR*.*.  (See also Wildcards.)
  346.  
  347. The hardest part to figure out, about the |nRESTORE|n command, is that the
  348. filenames and the directory structure are stored as part of the backup
  349. disks, and that's the way they get restored.  If you used to keep your
  350. word processing program in a |ndirectory|n named \WORD, back when you made
  351. the |nbackup|n |ndisks|n, and nowadays you keep it in a |ndirectory|n named \WP, then
  352. if you use the command |nRESTORE|n A: C:\WP\*.* then the |nRESTORE|n command is
  353. going to give you a nasty error message like "No files found to restore",
  354. because you didn't have any files named \WP\*.* at the time you made the
  355. |nbackup|n |ndisks|n.  Those files used to be called \WORD\*.* instead.  So in
  356. order to restore them, you'll have to use |nRESTORE|n A: C:\WORD\*.* and the
  357. |nRESTORE|n command will create a |ndirectory|n called C:\WORD and put the files
  358. there, and then you'll have to use the COPY command to put them into the
  359. \WP |ndirectory|n, then delete the files from the \WORD |ndirectory|n and RMDIR
  360.                            <page down> for more
  361.                              RESTORE continued
  362. the \WORD directory.  Restoring those files to D:\WORD wouldn't have been
  363. a bit of a problem though.  Different drive but same |ndirectory|n, is ok.
  364.  
  365. So, what switches are available with the |nRESTORE|n command?  Quite a few:
  366.           /S   /P   /N   /M   /A:date   /B:date   /L:time   /E:time
  367. The /S switch tells DOS to also restore the files in the subdirectories
  368. of the target |ndirectory|n.  If you had a |ndirectory|n named C:\WORD\LETTERS
  369. below your C:\WORD |ndirectory|n, and you used C:\WORD\*.* as the target of
  370. the |nRESTORE|n command, then if you leave out the /S switch, the files in
  371. C:\WORD\LETTERS will not be restored, or if you include the /S switch,
  372. then they will be restored.  If you want to restore all the files on your
  373. entire hard drive, then you always have to specify the /S switch, as well
  374. as using C:\*.* as your target.
  375.  
  376. The /P switch tells DOS to pause and ask you for confirmation every time
  377. it encounters any files that either have their Read-only attributes set
  378. on the target drive, or that have a more recent copy on the target drive
  379. than the copy on the backup disk.  In most cases, if the copy on the tar-
  380.                            <page down> for more
  381.                              RESTORE continued
  382. get drive is newer than the copy on the backup disk, then you probably do
  383. not want |nRESTORE|n to overwrite the newer copy with the older copy.  How-
  384. ever, if you know that the newer copy on the target drive has been ruined
  385. in some way, then yes, you do want to restore the older copy.
  386.  
  387. The /N switch only came into existence with version 3.3 of DOS, and it's
  388. about time!  This switch will find all the files that exist on the |nbackup|n
  389. disks, that no longer exist on the target disk.  That means if you delete
  390. a bunch of files accidentally, you can just restore them from the |nbackup|n
  391. |ndisks|n without going through a complete restore!  There is one very small
  392. problem with this, however.  If you have renamed a file since you made
  393. the |nbackup|n, the /N switch of |nRESTORE|n will find that the file (under its
  394. old name) no longer exists on the target disk (because it now has some
  395. other name) so it will restore that file.  So now you have the old copy
  396. of the file, under its old name, as well as the |ncurrent|n copy of the file,
  397. under its new name.  That's a waste of hard disk space!  So be sure and
  398. check for this sort of thing whenever you use the /N switch with |nRESTORE|n,
  399. and delete the old copies of renamed files.
  400.                            <page down> for more
  401.                              RESTORE continued
  402. The /M switch does the same thing as the /N switch, and more!  It also
  403. restores any files that have been changed since the backup was made.  It
  404. will replace the more recent copy of the file, with the old out-of-date
  405. copy.  This is useful for when you've made some sort of a big goof and
  406. messed up all your hard drive's data files, and you need to get back the
  407. old copies from before you did that.
  408.  
  409. The next four switches are all new with version 3.3 of DOS, and they all
  410. have to do with time.  The /A switch will restore all the files from the
  411. |nbackup|n disks that have a date that's the same or later than the date you
  412. specify with the /A:date switch.  The /B switch will restore all of the
  413. files whose date is the same or earlier than the date you specified.  The
  414. /L:time and /E:time switches must only be used with the /A or /B switch.
  415. /L means files that have the same time or a later time than the one you
  416. specify, and /E means files whose time is the same or earlier than the
  417. one you specified.
  418.  
  419. Before version 3.3 of DOS, the |nBACKUP|n command backed up the Hidden Files,
  420.                            <page down> for more
  421.                              RESTORE continued
  422. which are IO.SYS and MSDOS.SYS for MS-DOS, or IBMBIO.COM and IBMDOS.COM
  423. for PC-DOS, so that if you upgraded to a new DOS version, and then you
  424. needed to restore some files from your old backup disks, you would have
  425. to be very careful to see that |nRESTORE|n didn't try to put your old Hidden
  426. files back on the disk, right over top of the ones from your new DOS ver-
  427. sion!  If you still have version 3.2 or an earlier version, then watch
  428. out for this.  But of course now that Microsoft is selling DOS version
  429. 5.0 right to the public, instead of only to computer dealers, there's no
  430. reason for you to stick with an old version.  DOS 5 is fantastic!
  431.  
  432. Many previous versions of the DOS |nRESTORE|n command could only restore
  433. files that were made by the |nBACKUP|n command from that same DOS version.
  434. But not DOS 5.0!  It can restore |nbackup|n files from DOS 2.11 or later.
  435.  
  436. There is also a new switch for the DOS 5 |nRESTORE|n command.  The /D switch
  437. will show you what files will be restored by the command you are entering
  438. but it will not restore any files.  Use the command with the /D switch
  439. first, as a test, and if it shows you the right filenames, you enter the
  440. same command again, only without the /D switch, to restore them.
  441.                               What Is |tASCII|t?
  442.  
  443. |nASCII|n stands for American Standard Code for Information Exchange.  It's
  444. pronounced "ASK-ee".  It's like a common ground on which different types
  445. of programs can communicate.
  446.  
  447. Say you have some data in a database, that you want to use in your spread
  448. sheet.  Well databases and spreadsheets generally speak two different
  449. languages.  But they both have one language in common.  You can export
  450. the database data into an |nASCII|n file, and import that |nASCII|n file into
  451. your spreadsheet, and then your spreadsheet will be able to understand
  452. the database data!
  453.  
  454. An |nASCII|n file is just a text file that a human being could read, as op-
  455. posed to one of those files that just looks like total gibberish if you
  456. look at it with the TYPE command.
  457.  
  458. An |nASCII|n file is the only type of file that DOS can read, when it comes
  459. to |sbatch file|ss and things like that.  To make an |nASCII file|n, you can use
  460.                            <page down> for more
  461.                               ASCII continued
  462. any text editor, or your word processor also, if you can find the command
  463. that your word processor uses to export an |nASCII|n file.  Some word proces-
  464. sors make it easy by calling it "export", or "ASCII", or "text", but
  465. other word processors have to be difficult and call it something incom-
  466. prehensible like "non-document mode" or "unformatted files".
  467.  
  468. Well, now I suppose you want to see this set of codes that's known as
  469. |nASCII|n, right?  Ok, get ready, here are the decimal |nASCII|n codes.
  470.  
  471. Non-printing characters:  (These don't really count for a text file, but
  472. they still are part of the |nASCII|n standard.)
  473.    0     ^@  |nNUL|n  null      7    ^G  BEL  bell          14    ^N  SO
  474.    1    ^A  SOH            8     ^H  BS   <Backspace>   15    ^O  SI
  475.    2    ^B  STX            9     ^I  HT   <Tab>         16    ^P  DLE
  476.    3    ^C  ETX           10     ^J  LF   linefeed      17    ^Q  DC1
  477.    4    ^D  EOT           11     ^K  VT                 18    ^R  DC2
  478.    5    ^E  ENQ           12     ^L  FF   formfeed      19    ^S  DC3
  479.    6    ^F  ACK           13     ^M  CR   <Enter>       20    ^T  DC4
  480.                            <page down> for more
  481.                               ASCII continued
  482.   21    ^U  NAK           25    ^Y  EM                 29    ^`  GS
  483.   22    ^V  SYN           26     ^Z  EOF  End-of-File   30    ^=  RS
  484.   23    ^W  ETB           27     ^[  ESC  ESCape        31    ^-  US
  485.   24    ^X  CAN  cancel   28    ^\  FS
  486.  
  487. Printing characters:
  488.   32  <Space> 44  ,     56  8     68  D     80  P     92  \     104  h
  489.   33  !       45  -     57  9     69  E     81  Q     93  ]     105  i
  490.   34  "       46  .     58  :     70  F     82  R     94  ^     106  j
  491.   35  #       47  /     59  ;     71  G     83  S     95  _     107  k
  492.   36  $       48  0     60  <     72  H     84  T     96  `     108  l
  493.   37  %       49  1     61  =     73  I     85  U     97  a     109  m
  494.   38  &       50  2     62  >     74  J     86  V     98  b     110  n
  495.   39  '       51  3     63  ?     75  K     87  W     99  c     111  o
  496.   40  (       52  4     64  @     76  L     88  X    100  d     112  p
  497.   41  )       53  5     65  A     77  M     89  Y    101  e     113  q
  498.   42  *       54  6     66  B     78  N     90  Z    102  f     114  r
  499.   43  +       55  7     67  C     79  O     91  [    103  g     115  s
  500.                            <page down> for more
  501.                               ASCII continued
  502.   116  t     118  v     120  x     122  z     124  ||     126  ~
  503.   117  u     119  w     121  y     123  {     125  }     127  <Delete>
  504.  
  505. High-bit characters:  (Also called IBM |nASCII|n |nextended|n characters.)
  506. 128  Ç     142  Ä     156  £     170  ¬     184  ╕     198  ╞     212  ╘
  507. 129  ü     143  Å     157  ¥     171  ½     185  ╣     199  ╟     213  ╒
  508. 130  é     144  É     158  ₧     172  ¼     186  ║     200  ╚     214  ╓
  509. 131  â     145  æ     159  ƒ     173  ¡     187  ╗     201  ╔     215  ╫
  510. 132  ä     146  Æ     160  á     174  «     188  ╝     202  ╩     216  ╪
  511. 133  à     147  ô     161  í     175  »     189  ╜     203  ╦     217  ┘
  512. 134  å     148  ö     162  ó     176  ░     190  ╛     204  ╠     218  ┌
  513. 135  ç     149  ò     163  ú     177  ▒     191  ┐     205  ═     219  █
  514. 136  ê     150  û     164  ñ     178  ▓     192  └     206  ╬     220  ▄
  515. 137  ë     151  ù     165  Ñ     179  │     193  ┴     207  ╧     221  ▌
  516. 138  è     152  ÿ     166  ª     180  ┤     194  ┬     208  ╨     222  ▐
  517. 139  ï     153  Ö     167  º     181  ╡     195  ├     209  ╤     223  ▀
  518. 140  î     154  Ü     168  ¿     182  ╢     196  ─     210  ╥     224  α
  519. 141  ì     155  ¢     169  ⌐     183  ╖     197  ┼     211  ╙     225  ß
  520.                            <page down> for more
  521.                               ASCII continued
  522.     226  Γ     231  τ     236  ∞     241  ±     246  ÷     251  √
  523.     227  π     232  Φ     237  φ     242  ≥     247  ≈     252  ⁿ
  524.     228  Σ     233  Θ     238  ε     243  ≤     248  °     253  ²
  525.     229  σ     234  Ω     239  ∩     244  ⌠     249  ∙     254  ■
  526.     230  µ     235  δ     240  ≡     245  ⌡     250  ·     255  blank
  527.  
  528. |nExtended|n characters:  (These don't count for a text file but you may need
  529. them for ANSI.SYS keyboard reassignment, and such things.)  It takes two
  530. codes put together to represent the following characters.  The first code
  531. is always the |nASCII|n null, which is 0, and the two codes are separated by
  532. a semicolon (;).  So to represent the <F10> key, whose |nkeyboard|n scan code
  533. is 68, you would type 0;68.
  534.   1  Alt-ESC        18  Alt-E     24  Alt-O       31  Alt-S     37  Alt-K
  535.   3  Null           19  Alt-R     25  Alt-P       32  Alt-D     38  Alt-L
  536.  14  Alt-Backspace  20  Alt-T     26  Alt-[       33  Alt-F     39  Alt-;
  537.  15  Shift-Tab      21  Alt-Y     27  Alt-]       34  Alt-G     43  Alt-\
  538.  16  Alt-Q          22  Alt-U     28  Alt-Enter   35  Alt-H     44  Alt-Z
  539.  17  Alt-W          23  Alt-I     30  Alt-A       36  Alt-J     45  Alt-X
  540.                            <page down> for more
  541.                               ASCII continued
  542.  46  Alt-C           65  F7                 83  Delete       101  ^F8
  543.  47  Alt-V           66  F8                 84  Shift-F1     102  ^F9
  544.  48  Alt-B           67  F9                 85  Shift-F2     103  ^F10
  545.  49  Alt-N           68  F10                86  Shift-F3     104  Alt-F1
  546.  50  Alt-M           69  Numlock            87  Shift-F4     105  Alt-F2
  547.  51  Alt-,           70  Scroll Lock        88  Shift-F5     106  Alt-F3
  548.  52  Alt-.           71  Home               89  Shift-F6     107  Alt-F4
  549.  53  Alt-/           72  Up                 90  Shift-F7     108  Alt-F5
  550.  55  Alt-* (keypad)  73  Pg Up              91  Shift-F8     109  Alt-F6
  551.  56  Alt-Break       74  Alt-- (keypad)     92  Shift-F9     110  Alt-F7
  552.  57  Alt-Space       75  Left               93  Shift-F10    111  Alt-F8
  553.  58  Capslock        76  Shift-5 (keypad)   94  ^F1          112  Alt-F9
  554.  59  F1              77  Right              95  ^F2          113  Alt-F10
  555.  60  F2              78  Alt-+ (keypad)     96  ^F3          114  ^Prt Sc
  556.  61  F3              79  End                97  ^F4          115  ^Left
  557.  62  F4              80  Down               98  ^F5          116  ^Right
  558.  63  F5              81  Pg Dn              99  ^F6          117  ^End
  559.  64  F6              82  Insert            100  ^F7          118  ^Pg Dn
  560.                            <page down> for more
  561.                               ASCII continued
  562.    119  ^Home      134  F12                    149  ^/ (keypad)
  563.    120  Alt-1      135  Shift-F11              150  ^* (keypad)
  564.    121  Alt-2      136  Shift-F12              151  Alt-Home
  565.    122  Alt-3      137  ^F11                   152  Alt-Up
  566.    123  Alt-4      138  ^F12                   153  Alt-Pg Up
  567.    124  Alt-5      139  Alt-F11                155  Alt-Left
  568.    125  Alt-6      140  Alt-F12                157  Alt-Right
  569.    126  Alt-7      141  ^Up/8 (keypad)         159  Alt-End
  570.    127  Alt-8      142  ^- (keypad)            160  Alt-Down
  571.    128  Alt-9      143  ^5 (keypad)            161  Alt-Pg Dn
  572.    129  Alt-0      144  ^+ (keypad)            162  Alt-Insert
  573.    130  Alt--      145  ^Down/2 (keypad)       163  Alt-Delete
  574.    131  Alt-=      146  ^Insert/0 (keypad)     164  Alt-/ (keypad)
  575.    132  ^Pg Up     147  ^Delete/. (keypad)     165  Alt-Tab
  576.    133  F11        148  ^Tab                   166  Alt-Enter (keypad)
  577.  
  578. Remember that a symbol such as ^Home means <Ctrl-Home> which means for
  579. you to hold down one of the <Ctrl> keys while you hit the <Home> key.
  580.  
  581.                             How Do |tDisks|t Work?
  582.  
  583. The easiest way to think about |ndisks|n is like a phonograph record.  You
  584. know, like an album.  A disk is a round thing with a hole in the middle,
  585. that spins around and has the head (needle) of a drive (record player)
  586. moving back and forth across it to read the parts it wants to read.  Ok,
  587. a record player can't do that part, it can only read the whole disk from
  588. beginning to end unless you pick up the needle and move it somewhere else
  589. on the record.  But unlike a record player, a disk drive does have some-
  590. one standing there to pick up the head and move it to another area of the
  591. disk whenever it wants to.  That's one job of the drive controller.
  592.  
  593. On a record player, there is only one "track" per side.  That track is in
  594. a spiral which reaches from the outside edge of the disk, all the way to
  595. the center where the label is.  That's not the case for a disk, because a
  596. disk's tracks are concentric circles rather than one long spiral.  Each
  597. track is a closed circle, slightly smaller than the track outside it, and
  598. slightly larger than the track inside it.
  599.  
  600.                            <page down> for more
  601.                               Disks continued
  602. Each track is divided into sectors.  Each sector is just a small arc of
  603. the circle.  If you cut a disk up into pieces like a pie, then one piece
  604. of the "pie" would contain one sector from each track of the disk.  A
  605. sector holds 512 bytes of data.
  606.  
  607. Now a cylinder is all the tracks of the disk that are an equal distance
  608. from the edge.  So each cylinder of a floppy disk has only two tracks--
  609. one on side one of the |nfloppy|n, and one on side two.  All the other tracks
  610. on the |nfloppy|n are some other distance from the edge.
  611.  
  612. But since a hard drive has several platters (|ndisks|n) inside it, a cylinder
  613. on a hard drive can have lots of tracks.  Track 5 of side one of platter
  614. one, track 5 of side two of platter one, track 5 of side one of platter
  615. two, track 5 of side two of platter two, track 5 of side one of platter
  616. three, all these tracks are in the same cylinder of the hard drive.
  617.  
  618. Ok, those were the physical parts of a disk.  Now what about the logical
  619. parts?  How does DOS use |ndisks|n?  Well every disk has a directory and a
  620.                            <page down> for more
  621.                               Disks continued
  622. FAT.  These are the parts that are used like we use the table of contents
  623. and the index of a book.  Every file that's on the disk gets a directory
  624. entry.  Every cluster of the disk gets a |nFAT|n entry, whether there is any
  625. file in that cluster or not.  Clusters are also called Allocation Units.
  626.  
  627. What's a cluster?  Well, now, that's kind of tough to explain.  First of
  628. all, it depends on the size of the disk in question, and also on the ver-
  629. sion of DOS that was used to FORMAT the disk.  Sometimes a cluster is the
  630. same as just one sector, 512 bytes.  Other times a cluster can be 1024
  631. |nbytes|n, 2048 |nbytes|n, 4096 |nbytes|n, 8192 |nbytes|n, or 16,384 |nbytes|n.  You see,
  632. since every cluster of a disk has to have a |nFAT|n entry then if the size
  633. of the cluster was only the same as the sector size, the |nFAT|n would have
  634. to be awfully big to hold an entry for every cluster of the disk.
  635.  
  636. So for most |ndisks|n, DOS uses clusters that are larger than the sectors.
  637. That way the |nFAT|n can remain at a reasonable size.  But there's a problem
  638. with that.  Since there can only be one filename in each |nFAT|n entry, DOS
  639. wastes a lot of space on hard drives.  A bunch of space even gets wasted
  640.                            <page down> for more
  641.                               Disks continued
  642. on floppy |ndisks|n too, but not as much, because of the smaller clusters.
  643.  
  644. If you write a 27-byte file to disk, it takes up a whole cluster of disk
  645. space because there is only one FAT entry for each cluster, and there can
  646. only be one file for each |nFAT|n entry.  So on a |nfloppy|n disk with 512-byte
  647. clusters, that 27-byte file causes 485 bytes worth of disk space to be
  648. wasted!  (That's called "slack space".)  On most hard |ndisks|n the cluster
  649. size is 4 sectors, or 2048 |nbytes|n, so that 27-byte file is wasting 2021
  650. |nbytes|n of disk space!  It boggles the mind, doesn't it?
  651.  
  652. If you have a hard drive that is 16M or smaller, then DOS is probably
  653. giving you 4096-byte clusters!  That 27-byte file is now wasting 4069
  654. |nbytes|n of disk space!  Even if you have a very large hard drive, if you
  655. have it partitioned into logical drives that are smaller than 16M, you
  656. still have that ridiculous 8-sector cluster size.  You'd better get your
  657. drive repartitioned if you can!  The FDISK command can do that.  The same
  658. 8-sector cluster size goes for partitions between 129M and 256M too, and
  659. larger partitions than that get even huger cluster sizes!
  660.                            <page down> for more
  661.                               Disks continued
  662. This is why sometimes when you're trying to copy 357K worth of files to
  663. a 360K floppy, you can sometimes get a "|tdisk full|t" error message.  (See
  664. also Directory.)  Now that one is really confusing unless you know this
  665. about how DOS won't use up the end of a cluster for a new file if there
  666. is already a file using up part of that cluster.
  667.  
  668. This is also why it's important to try to combine all your teeny tiny
  669. batch files into one big batch file.  I have one |nbatch file|n (other than
  670. |sAUTOEXEC.BAT|s) on my entire hard drive, and it can perform 49 different
  671. functions.  Its size is 12,538 so it takes up 7 clusters or 14,336 bytes
  672. worth of disk space.  If I had it all broken down into 49 batch files,
  673. the way most people do, it would be taking up 49 clusters or 100,352
  674. |nbytes|n of disk space!  See the section on the GOTO command to see how to
  675. combine them like that.
  676.  
  677.  
  678.  
  679.  
  680.  
  681.                            What Is a |tBoo|1t Disk|t?
  682.  
  683. A |nboot|n disk is a disk that has been made bootable.  This is the only kind
  684. of disk that a computer will boot from.  What makes a disk bootable?  It
  685. has to have a |nboot|n record on it, as well as having the two system files
  686. (|sIO.SYS|s and MSDOS.SYS for MS-DOS or IBMBIO.COM and IBMDOS.COM for PC-DOS)
  687. in the right area of the disk, and it also has to have COMMAND.COM on it.
  688.  
  689. How do you make a bootable disk?  (That's also called a "system disk".)
  690. It's really easy.  You just use the |nFORMAT|n A: /S command.  That command
  691. will put all of those necessary ingredients onto the disk.  Don't forget
  692. that the FORMAT command will first remove all data from the disk.
  693.  
  694. Another way is to use the command |nSYS|n A: and then COPY the |nCOMMAND.COM|n
  695. file to the disk.  The |tSYS|t command will put the system files from the
  696. current drive, and the |nboot|n record onto the specified disk, but not the
  697. |nCOMMAND.COM|n file.  (DOS 5.0's |nSYS|n command will do that too, though.)
  698.  
  699. It is possible to make a disk bootable after it already has some other
  700.                            <page down> for more
  701.                             Boo|1t Disk continued
  702. files on it, but it's not easy.  Well, if the disk used to be bootable
  703. but the system files were corrupted in some way, then the SYS command can
  704. probably do it.  But if the disk never had the system files on it, and
  705. there are other files on it, then the |nSYS|n command probably won't work,
  706. because the system files have to go right at the beginning of the disk,
  707. so if there are any other files in that spot, then |nSYS|n won't be able to
  708. put the system files there.  There are some hard drive utility packages,
  709. such as the Norton Utilities, that can do it, by moving the other files
  710. out of the way to make room for the system files, but the |nSYS|n command
  711. just can't do it except in DOS 5 which is not so picky about such things.
  712.  
  713. What happens if you try to boot from a disk that has not been made |nboot|n-
  714. able?  Not a whole lot.  That's the problem.  You'll get an error message
  715. like, "|sNon system disk|s replace and strike any key".  And that's all that
  716. will happen.
  717.  
  718. The only disks that can be bootable are A: and C:.  Those are the only
  719. ones that the computer will check.  Your access light on drive B: will
  720.                            <page down> for more
  721.                             Boo|1t Disk continued
  722. come on while booting, but that is only part of the POST.  When the com-
  723. puter gets ready to look for the system files to load them into memory,
  724. it looks on A: and if there is a bootable disk in that drive, then it
  725. boots from there, otherwise, it looks at C: to see if that one's |nboot|n-
  726. able.  If neither A: nor C: holds a bootable disk, then your computer
  727. isn't going to do anything.
  728.  
  729. There are just a couple of brands and models of computer that can boot
  730. from the B: drive if they're specially set up to do so, but those are few
  731. and far between.  If you don't have one of those, then there are only two
  732. ways to ever |nboot|n from a disk in the B: drive.
  733.  
  734. One way is to open up the computer's case, switch the cables that run be-
  735. tween the drive controller and the A: and B: drives, and then if you have
  736. a 286 or higher machine, go into your CMOS setup and tell it that A: is
  737. now B: and B: is now A:.  Right, technically you're still not booting
  738. from the B: drive, because now it's the A: drive, but you're booting
  739. from what used to be the B: drive.
  740.                            <page down> for more
  741.                             Boo|1t Disk continued
  742. The other way is with a shareware program called B-|nBOOT|n or |nBOOT|n-B (it is
  743. listed by different names on different |sBBS|ss).  Your A: drive does have to
  744. be in working order for this to work.  The program creates a special disk
  745. for your A: drive that is not bootable, but that has some data on it that
  746. tells the computer to go look on the B: drive for the system files.  So
  747. when the computer tries to boot from A:, it ends up going to B:.
  748.  
  749. If you have a |sfloppy|s-only system, you need to make sure you have lots of
  750. copies of the disk you usually |nboot|n from.  You never can tell when three
  751. copies of that disk are going to go bad all at once.  Keep several copies
  752. in several different places.
  753.  
  754. If you have a hard drive and it is bootable, for heaven's sake do not
  755. think that means you don't need to keep bootable floppies around!  You
  756. most certainly do!  Hard drives die and that's all there is to it.  Be-
  757. sides, what if you're messing around trying to improve your configuration
  758. by editing your CONFIG.SYS and/or AUTOEXEC.BAT files, and you make some
  759. error that locks up your system?  Do you think that rebooting will help
  760.                            <page down> for more
  761.                             Boo|1t Disk continued
  762. you in that case?  If you |nreboot|n from the same disk that has the bad con-
  763. figuration file, you'll just lock the system up again!  You need to boot
  764. from a floppy that has no AUTOEXEC.BAT and CONFIG.SYS files, or that has
  765. older copies of those files, from before you messed them up.  (By the
  766. way, if you did mess them up, don't feel bad!  It happens to the best of
  767. us!)
  768.  
  769. Well, as I said, the only thing that needs to be done to make a bootable
  770. disk, is to use the |nFORMAT|n A: /S command or else the |nSYS|n A: and |nCOPY|n COM-
  771. MAND.COM A: commands.  A disk that has had this done to it will |nboot|n the
  772. computer, but it may not make all of your peripherals work.  Suppose you
  773. have some unusual hard drive which requires a special device driver, such
  774. as DMDRVR.BIN, in the |nCONFIG.SYS|n file to make the drive recognizable to
  775. DOS?  You'll be able to |nboot|n from a disk with no |nCONFIG.SYS|n file on it,
  776. but you won't be able to use your hard drive in that case.
  777.  
  778. You really need to know what every single thing in your |nAUTOEXEC.BAT|n and
  779. |nCONFIG.SYS|n files does, so that you'll know which ones it is absolutely
  780.                            <page down> for more
  781.                             Boo|1t Disk continued
  782. necessary for your |nboot|n disk to have on it.  There are times when you
  783. will want to boot up with the fewest possible number of commands in your
  784. AUTOEXEC.BAT and CONFIG.SYS files, to save RAM, so you need to know what
  785. the absolutely necessary commands for your system are.  Most people can
  786. |nboot|n up perfectly well from a disk without any |nAUTOEXEC.BAT|n or |nCONFIG.SYS|n
  787. files, but if your system has some special configuration, you need to
  788. know about it.  So if there is some command in your |nCONFIG.SYS|n or AUTO-
  789. EXEC.BAT file that you can't find mentioned anywhere here or in any other
  790. DOS manual you have, or in any of the papers that came with your system,
  791. then you need to call the dealer from whom you purchased your computer
  792. and ask him about them.
  793.  
  794. If you have any commands in your |nAUTOEXEC.BAT|n or |nCONFIG.SYS|n files that
  795. really have to be executed in order for your system to work properly,
  796. then besides creating an |nAUTOEXEC.BAT|n or |nCONFIG.SYS|n file that contains
  797. that command and putting it on your |nboot|n disk, you also need to make
  798. sure the command file for that command is on the |nboot|n disk too.  You
  799. might be tempted to put the command into the file like this:
  800.                            <page down> for more
  801.                             Boo|1t Disk continued
  802.           C:\UTIL\COMMAND
  803. but what if your hard drive seems to have lost all its data?  Your system
  804. won't be able to access the command file on the C: drive.  Make sure you
  805. copy the command file to the |nboot|n disk and change the line in AUTOEXEC
  806. .BAT to A:\COMMAND.  Do that for every single external command (that is,
  807. commands that are not part of |sCOMMAND.COM|s) that has to be listed in the
  808. AUTOEXEC.BAT and CONFIG.SYS files on the bootable floppy.
  809.  
  810. Did you ever wonder how on earth you would RESTORE your BACKUP disks if
  811. your hard drive died and you couldn't access the |nRESTORE|n command that's
  812. in your C:\DOS |sdirectory|s?  Well you'd better put a copy of your |nRESTORE|n
  813. .COM file onto your bootable |nfloppy|n disk right now, don't you think?
  814.  
  815. So, you should have a few different copies of each type of bootable flop-
  816. py that you make, and you should make several different kinds.  One that
  817. has no |nCONFIG.SYS|n or |nAUTOEXEC.BAT|n (or if you need some special device
  818. driver to make your hard drive accessible, put the one-line |nCONFIG.SYS|n
  819. file onto the |nfloppy|n too) and another kind that will boot your system
  820.                            <page down> for more
  821.                             Boo|1t Disk continued
  822. up just the way you always have it set up.  Put the same CONFIG.SYS and
  823. AUTOEXEC.BAT files you have on your hard drive, onto the floppy, and make
  824. all the changes necessary to make DOS able to find the command files on
  825. the |nfloppy|n instead of the hard drive.  By that I mean change the commands
  826. from C:\DOS\COMMAND to A:\COMMAND and then of course copy all the command
  827. files to the |nfloppy|n also.  And whatever command you use to restore your
  828. |sBACKUP|ss, that command file must also be there.  Label those floppies like
  829. "Clean |nBoot|n" (for the one with no |nAUTOEXEC.BAT|n and |nCONFIG.SYS|n files) and
  830. "Full |nBoot|n" (for the one with your regular configuration files) and you
  831. are all set for any hard drive emergency.
  832.  
  833. If you have DOS version 4, no earlier version, no later version, just 4,
  834. and if you have a hard drive partition larger than 32 mega|sbytes|s, then
  835. there is one more file you need to have on your |nboot|n disk!  |nSHARE|n.EXE!
  836. You absolutely and definitely and always must have that file in the same
  837. directory with COMMAND.COM, every time you boot up, so that SHARE will
  838. get loaded into memory, if you have version 4 and a hard drive partition
  839. larger than 32 megs!  This is true for any disk you |nboot|n from, whether it
  840. be a hard disk or |nfloppy|n disk.
  841.                         What Are |tExecutable|t Files?
  842.  
  843. An |nexecutable|n file actually means any file with the extension .EXE, but
  844. in general, it means any file that the computer can execute as a command.
  845. There are two |nexecutable|n extensions other than .EXE, and they are .COM
  846. and .BAT.  A file with the .BAT extension is a batch file, and a file
  847. with the .COM extension is a command file.  There's another misleading
  848. term, because generally any .EXE, .COM, or .BAT file is a command.
  849.  
  850. Files that do not have one of these three extensions cannot be executed.
  851. They can only be used as parameters to some other command.  For example,
  852. .|nSYS|n files are |sdevice driver|ss which are used as |nparameters|n to the DEVIC|1E
  853. command in the CONFIG.SYS file.  .WK1 files are spreadsheets, .DBF files
  854. are data bases, .DOC files are word processor documents, .BAS files are
  855. program files in the BASIC language that can only be read by the BASIC,
  856. BASICA, GWBASIC, or QBASIC interpreters.  These are just a few of the
  857. most common non-|nexecutable|n file extensions.
  858.  
  859. When executing a command, it is not necessary to type the command file's
  860.                            <page down> for more
  861.                            Executable continued
  862. extension, just the filename.  First DOS looks at the copy of COMMAND.COM
  863. in memory to see if there is an internal command with that name.  If so,
  864. DOS will execute the command.  If not, DOS will look in the current dir-
  865. ectory for a file with that name and the extension .COM.  If not found,
  866. DOS will look for a file with that name and an .EXE extension, and if not
  867. found, a .BAT extension.  If none of those are found in the |ncurrent|n dir-
  868. ectory, then DOS will search for those same filenames in each directory
  869. listed on the PATH statement in the environment.  If no |nexecutable|n file
  870. with that name is found in any of these places, you'll see the famous
  871. "|sBad command or filename|s" message.
  872.  
  873. However, if the full file specification (pathname) to the command is in-
  874. cluded on the command line, the only place DOS will search for a .COM,
  875. .EXE, or .BAT file with that name, is in that specified |ndirectory|n!  DOS
  876. won't even execute an internal command if one exists by that name, if the
  877. |ndirectory|n is specified on the command line.  So if you should for some
  878. reason need to have a command file named |nCLS|n.EXE, it is possible to have
  879. that file executed even though DOS searches the internal command table
  880.                            <page down> for more
  881.                            Executable continued
  882. before searching any directories.  You just need to specify the path to
  883. the |nCLS|n.EXE file on the command line, or else if the |nCLS|n.EXE is in the
  884. current directory, use the shortcut .\CLS.  (See also ". and ..".)  That
  885. will execute the CLS command file rather than the |nCLS|n internal command.
  886.  
  887. If you have a file named HELLO.EXE and a file named HELLO.COM, or if you
  888. have two different HELLO.COM files in two different directories, the one
  889. that's closest to the beginning of the |nPATH|n variable is always the one
  890. that will get executed, unless you're in the same |ndirectory|n with the
  891. other one, or you specify the pathname on the command line.
  892.  
  893. Now here's something interesting that I recently found out.  Every single
  894. DOS book that I've ever read which has brought up this subject has said
  895. the following:  If there is a .COM file, an .EXE file, and a .BAT file
  896. with the same first name, in the same |ndirectory|n, then there is no way
  897. the .EXE or .BAT files will ever be executed, not even if you enter the
  898. command as FILE.EXE or FILE.BAT, because DOS will just ignore the exten-
  899. sion of the file and look for a command in the normal order:  internal,
  900.                            <page down> for more
  901.                            Executable continued
  902. then .COM, then .EXE, and then .BAT.
  903.  
  904. Well that was true in earlier versions of DOS, but it is not true any
  905. more, and the DOS manual authors just haven't figured it out yet.  I just
  906. copied |nCHKDSK|n.COM and |nGWBASIC|n.EXE to an empty directory, renamed them to
  907. TEST.COM and TEST.EXE, and created a TEST.BAT file that just said, "|nECHO|n
  908. It works!"  Now what I had was three different commands that all had the
  909. first name of TEST.  So I entered the command TEST and what got executed
  910. was CHKDSK which had been renamed to TEST.COM.  That's just what should
  911. have happened.
  912.  
  913. Now according to all the DOS books, when I entered TEST.EXE as a command,
  914. I should have gotten a |nCHKDSK|n report once again.  Nope.  I got GWBASIC.
  915. Then when I entered TEST.BAT, I got "It works!"
  916.  
  917. This works for me with MS-DOS versions 4.01 and 5.0, but not with 3.2 or
  918. 3.3.  But even the books that say they are updated for version 4.01 are
  919. still saying it can't be done.  This just goes to show that you can't al-
  920.                            <page down> for more
  921.                            Executable continued
  922. ways be sure of anything when it comes to computers.  Just because some-
  923. thing was true in 1983 doesn't mean it's still true in 1991, even if all
  924. the DOS books are still saying it!
  925.  
  926. As a matter of fact, remember what I said about executing an .EXE file
  927. with the same first name as an internal command, like |nCLS|n.EXE?  All the
  928. books also say that is impossible, unless you patch your COMMAND.COM file
  929. to change the name of the internal CLS command.  But it's not true.  You
  930. don't have to patch |nCOMMAND.COM|n to execute a |nCLS|n.EXE file.  You just have
  931. to specify the |spath|sname of the file on the command line, like I said.  I
  932. just tested it on MS-DOS versions 3.2, 4.01, and 5.0 to make sure before
  933. I said it.  No problem.
  934.  
  935. Books are not always right!  (Now doesn't it make you feel good, to know
  936. that?)  These things were true for so long, in all the earlier versions
  937. of DOS, that everyone, even the authors of the DOS books, just accepts
  938. them as gospel, without even testing to find out whether they're still
  939. true or not.
  940.                            <page down> for more
  941.                            Executable continued
  942. Ready for some more confusion?  |nExecutable|n files can be called commands,
  943. utilities, programs, or applications!  There are some vague differences
  944. between these terms, but they're basically interchangeable, more or less.
  945.  
  946. Internal commands, those that are inside the COMMAND.COM file, are defin-
  947. itely called commands.  The DOS commands that require |nexecutable|n files
  948. can be called external commands, or DOS utilities, or DOS programs.  Ex-
  949. ecutable files that don't come from DOS can be called programs, utilit-
  950. ies, or applications.  A utility almost always refers to some command
  951. that performs a very specific function, and that does not require any
  952. overlay or support files.  A program can mean either a utility or an app-
  953. lication.  And an application is usually a great big program that should
  954. have a whole directory all to itself, that has a whole bunch of overlays
  955. and support files, that is used to do your work, not just for things that
  956. are only related to the computer itself.  Examples of applications are
  957. word processors, database managers, spreadsheets, desktop publishers, ac-
  958. counting or payroll programs, things like that.  But you can't run any of
  959. these without an |nexecutable|n file, with the .COM, .EXE, or .BAT extension.
  960.  
  961.                            What Are |tParameters|t?
  962.  
  963. |nParameters|n are anything that comes after the command on the command line.
  964. They tell DOS what you want to do with the command.  Take, for instance,
  965. the COPY command.  You can't just tell DOS to "|nCOPY|n".  You have to say
  966. what you want to copy and where you want it copied to.  So you might give
  967. a command like |nCOPY|n A:FILE.TXT B:, which tells DOS to copy the file named
  968. FILE.TXT which is on the A: drive, over to the B: drive.  In this case,
  969. "A:FILE.TXT" is the parameter that tells DOS the source for the |nCOPY|n com-
  970. mand, and "B:" is the parameter that tells the target.
  971.  
  972. There is another type of parameter called a "switch".  The /P in the com-
  973. mand |nDIR|n /P is a switch that tells DOS to "pause" after 23 lines of the
  974. output of the DIR command, so that you have time to see what it says, and
  975. then you strike any key to make the display continue on with the next 23
  976. lines.
  977.  
  978. DOS always uses "/" as the switch character, but some programs such as
  979. the compression utility PKZIP, use "-" as in PKZIP -a FILE *.*.  A switch
  980.                            <page down> for more
  981.                            Parameters continued
  982. is just a parameter that tells the program to "do its thing" in a slight-
  983. ly different way than normal.
  984.  
  985. The first "word" that is typed on the command line after the name of the
  986. command is parameter number one, and the second "word" is parameter two,
  987. etc.  By "word" I mean something that is surrounded by spaces.  So even
  988. though you wouldn't normally think of "B:" as being a "word", in this
  989. case it is since in the command |nCOPY|n A:FILE.TXT B: it is surrounded by
  990. spaces.  So it is parameter number two.
  991.  
  992. |tReplaceable|t |nparameters|n are very useful in batch files.  What this term
  993. means is a little symbol in a batch file that looks like %1 or %2 and it
  994. is "replaced" by whatever you happened to type as parameter number one or
  995. number two on the command line.  An example would be the best definition.
  996.  
  997. Suppose you create a |nbatch file|n called AB.BAT that looks like this:
  998.           @ECHO OFF
  999.           |nCOPY|n A:%1 B:
  1000.                            <page down> for more
  1001.                            Parameters continued
  1002. Now if you were to type this command on the command line:
  1003.           AB FILE.TXT
  1004. Then when DOS is processing that command, it sees the %1 symbol inside
  1005. the batch file and looks back on the command line to see what you had
  1006. typed as the first "word" after the command AB, and it sees FILE.TXT, so
  1007. it puts FILE.TXT there where the |nbatch file|n says %1, and this is the com-
  1008. mand that DOS executes:
  1009.           |nCOPY|n A:FILE.TXT B:
  1010. Now suppose the next time you run that AB.BAT file, you use this command
  1011. instead:
  1012.           AB HELLO.TXT
  1013. This time when DOS gets to the line that has the %1 symbol, and looks on
  1014. the command line and sees HELLO.TXT as the first parameter, then this is
  1015. the command that gets executed:
  1016.           |nCOPY|n A:HELLO.TXT B:
  1017.  
  1018. Now you can see that a file like AB.BAT is not going to save you all that
  1019. much typing, but how about a command like |nPROMPT|n $e[1;32;40m.  That's the
  1020.                            <page down> for more
  1021.                            Parameters continued
  1022. command you want to use to change your DOS colors to green-on-black.  Not
  1023. exactly an easy-to-remember command.  You can create a batch file that
  1024. will remember that command for you, like this COLOR.BAT:
  1025.           @PROMPT $e[1;3%1;4%2m
  1026.                     (blank line goes here)
  1027.           @ECHO OFF
  1028.           |nPROMPT|n $P$G
  1029. Now if you were to type COLOR 2 0 on the command line, DOS would put the
  1030. 2 in place of the %1, and 0 in place of the %2, and that same $e[1;32;40m
  1031. parameter for the PROMPT command would be used, without your memorizing
  1032. that complicated syntax.  (The 1; means for ANSI to use bold text.)
  1033.  
  1034. If you got bored with green-on-black, you could just type COLOR 7 4 and
  1035. DOS would put the 7 where the %1 is, and 4 where the %2 is, and this time
  1036. you'd get white-on-blue.  (See the subject ANSI.SYS for the color codes
  1037. and further information about how to change your DOS screen colors.)
  1038.  
  1039. You can use replaceable |nparameters|n to take the place of any part of a
  1040.                            <page down> for more
  1041.                            Parameters continued
  1042. command, even the command itself.  Suppose you do a lot of changes on
  1043. your AUTOEXEC.BAT file, and you're tired of typing that filename.  You
  1044. could have a batch file called AEB.BAT that looks like this:
  1045.           @ECHO OFF
  1046.           %1 |nAUTOEXEC.BAT|n %2
  1047. Now if you typed AEB |nTYPE|n, then the command |nTYPE|n |nAUTOEXEC.BAT|n would be
  1048. executed, or if you typed AEB |nEDLIN|n, then |nEDLIN|n |nAUTOEXEC.BAT|n would be
  1049. executed, because if there is no third word typed on the command line,
  1050. then %2 equals nothing, so having that %2 sitting there won't cause any
  1051. trouble.  If you typed the command AEB |nCOPY|n B:, then the command |nCOPY|n
  1052. |nAUTOEXEC.BAT|n B: would be executed, and you'd have a |nbackup|n copy of your
  1053. file, for in case the copy on your hard drive gets damaged in some way.
  1054.  
  1055. Replaceable |nparameters|n are one of my favorite toys in DOS.  There are a
  1056. zillion things you can use them for.  The parameter %0 always stands for
  1057. the name of the |nbatch file|n that contains the %0 symbol, since the name of
  1058. the |nbatch file|n is the first "word" on the command line, and %0 is the
  1059. first |nreplaceable|n parameter.  But other than that, you can use the other
  1060. |nreplaceable|n |nparameters|n, %1 through %9, for anything your heart desires.
  1061.                             What Is a |tRAMdisk|t?
  1062.  
  1063. The way to get one of these is just to load the |TRAMDRIVE.SYS|T (for MS-DOS)
  1064. or |TVDISK.SYS|T (for PC-DOS) file as a device driver in your CONFIG.SYS file
  1065. and then reboot.  Well, now that you have a |nRAMdisk|n, what on earth is it?
  1066.  
  1067. A |nRAMdisk|n is a chunk of memory that has been made to act like a floppy
  1068. disk drive, only a really fast |nfloppy|n disk drive!  Because it's only a
  1069. chunk of RAM instead of a mechanical disk drive, the access time is just
  1070. the same incredibly low number as the access time for your |nRAM|n.  Other
  1071. than that, you can use it just exactly the way you'd use a disk.  A |nRAM|n-
  1072. disk is also known as a |tVirtual Disk|t.
  1073.  
  1074. The only thing you have to remember, though, is that the |nRAMdisk|n still is
  1075. made of |nRAM|n, even if it is acting like a disk drive, so if the power goes
  1076. out, everything that was on the |nRAMdisk|n is gone forever!  You've got to
  1077. remember that anything that's on the |nRAMdisk|n that gets changed, edited,
  1078. or updated, has to be saved to disk before the |npower|n is shut off, or be-
  1079. fore some lightning shuts the |npower|n off for you, or before you |nreboot|n!
  1080.                            <page down> for more
  1081.                              RAMdisk continued
  1082. It's best to use a |nRAMdisk|n only for files that don't get changed, such as
  1083. your favorite utilities and DOS command files.  If your hard drive does
  1084. not have an access time under 20ms, then you'll be absolutely amazed at
  1085. how much faster a batch file works if you run it from a |nRAMdisk|n instead
  1086. of from the hard drive.  Just put your |nRAMdisk|n at the very beginning of
  1087. the PATH command in your AUTOEXEC.BAT, so that DOS will look there first
  1088. for all your commands.  If you don't do that, then DOS will find the com-
  1089. mand file on your hard drive first, and run it from there, so it won't be
  1090. doing you any good to put the files onto the |nRAMdisk|n.
  1091.  
  1092. How do you get all your favorite command files, utilities, and batch
  1093. files onto the |nRAMdisk|n?  You just use COPY commands in your |nAUTOEXEC.BAT|n
  1094. file, like this, assuming your |nRAMdisk|n is drive letter F:
  1095.           |nCOPY|n C:\DOS\CHKDSK.COM F: > |nNUL|n
  1096.           |nCOPY|n C:\DOS\FORMAT.COM F: > |nNUL|n
  1097.           |nCOPY|n C:\DOS\FIND.EXE F: > |nNUL|n
  1098.           |nCOPY|n C:\BELFRY\MENU.BAT F: > |nNUL|n
  1099. The reason for the " > |nNUL|n" at the end of each line is because the output
  1100.                            <page down> for more
  1101.                              RAMdisk continued
  1102. of each COPY command is going to be a "1 file(s) copied" message, and you
  1103. don't want to be seeing that every time you boot your computer.  NUL is a
  1104. special imaginary device that DOS uses.  It basically means, "nowhere".
  1105. (See also Redirection.)
  1106.  
  1107. Another solution for getting rid of those "1 file(s) copied" messages, if
  1108. you have a whole lot of files to copy to the |nRAMdisk|n, and if you're very
  1109. careful and read every single word of this paragraph, is to leave off the
  1110. " > |nNUL|n" at the end of each of those lines, put the command |nCTTY|n |nNUL|n on
  1111. the line of the batch file just before the |nCOPY|n commands start, and put
  1112. the command |nCTTY|n |nCON|n on the line right after the last |nCOPY|n command.  If
  1113. you forget your |nCTTY|n |nCON|n command there, then you'll be in big trouble.
  1114. No output will ever go to the screen, and worse yet, no input will be
  1115. accepted from the keyboard.  Because what |nCTTY|n |nNUL|n does, is to redirect
  1116. all the input and output to the |nNUL|n device, until such time as a |nCTTY|n |nCON|n
  1117. command is given, which redirects everything back to the normal device
  1118. that gets used for standard input and output--your |sCON|ssole, or monitor-
  1119. and-keyboard.  (See the chapter on the CTTY command.)
  1120.                            <page down> for more
  1121.                              RAMdisk continued
  1122. A |nRAMdisk|n just gets the next higher letter, after all the drive letters
  1123. your system already has.  If you already have an E: drive, your |nRAMdisk|n
  1124. will get the letter F:.  Don't forget that the default LASTDRIVE is E:,
  1125. so if your |nRAMdisk|n is going to give you a higher letter than that, you
  1126. need to raise your |nLASTDRIVE|n by putting a statement like LASTDRIVE=F into
  1127. your CONFIG.SYS file.  Otherwise DOS won't be able to recognize what you
  1128. mean when you type F: to refer to your |nRAMdisk|n.
  1129.  
  1130. Another type of file that it's really good to put on a |nRAMdisk|n, is temp
  1131. files.  These are temporary files that get created by some applications
  1132. and then deleted by the same application when the app no longer needs it.
  1133. If the instruction manual for the app says that you can tell it where to
  1134. put its temp files, then tell it to put them on a |nRAMdisk|n.  That will
  1135. make your app run a lot faster than it would if it were using the hard
  1136. drive instead of the |nRAMdisk|n, for its temp files.
  1137.  
  1138. Don't worry about the fact that the |nRAMdisk|n will lose all its data if you
  1139. have a power failure.  Because even if the temp files were on the hard
  1140.                            <page down> for more
  1141.                              RAMdisk continued
  1142. drive, if the power went out the application would have lost its place in
  1143. the temp file anyway, and the temp file would now be useless to the app
  1144. and you would just have to delete it to free up the space it was taking
  1145. up on your disk.  So you're not losing anything by having the temp files
  1146. on the |nRAMdisk|n if the |npower|n goes out.
  1147.  
  1148. If you have any extended memory, then a |nRAMdisk|n is one of the best uses
  1149. for it!  The RAMDRIVE.SYS and VDISK.SYS |sdevice driver|ss contain their own
  1150. |nextended|n |nmemory|n managers, so you don't need any special software in order
  1151. for your |nRAMdisk|n to be able to use your |nextended|n |nmemory|n.  Just add the /E
  1152. switch to the end of that DEVIC|1E command in CONFIG.SYS, and your |nRAMdisk|n
  1153. will be placed into |nextended|n |nmemory|n instead of taking up space in your
  1154. conventional |nmemory|n.  (With DOS 5 you have to load HIMEM.SYS first.)
  1155.  
  1156. If you have a recent DOS version, you can also place your |nRAMdisk|n into
  1157. expanded |nmemory|n, if you don't have any |nextended|n |nmemory|n (|nextended|n is more
  1158. efficient), by using the /X or /A switch.  Which one is allowed, if ei-
  1159. ther, depends on the DOS version that you have.
  1160.                            <page down> for more
  1161.                              RAMdisk continued
  1162. Here is the complete syntax for the RAMDRIVE.SYS and VDISK.SYS drivers:
  1163.           DEVICE=D:\DIR\FILENAME.|nSYS|n AAAA BBB CC /E:D /X:D /A:D
  1164. where AAAA is the size of the |nRAMdisk|n in Kilo|sbytes|s, and the default is
  1165. 64.  The BBB parameter stands for the sector size you want the |nRAMdisk|n
  1166. to have.  The choices are 128, 256, and 512, with 128 being the |ndefault|n,
  1167. except for DOS version 5, where the |ndefault|n is 512.  If you are going to
  1168. be putting a lot of very small files onto the |nRAMdisk|n you will want to
  1169. use 128, but if you will have only large files and you just barely have
  1170. enough room on the |nRAMdisk|n for the files you want to put there, then use
  1171. the 512 byte sector size because with the larger sectors, DOS can give a
  1172. smaller amount of space to the FAT.  The CC parameter means the number of
  1173. root directory entries you'll need.  The |ndefault|n is 64, so if you're hard
  1174. up for space on your |nRAMdisk|n, and you're only going to need a few files
  1175. at a time, give a smaller number so that less |nRAMdisk|n space will be occu-
  1176. pied by the |ndirectory|n.  Or if you use a small number, then use one of
  1177. those |ndirectory|n entries for a subdirectory, and put all the files there.
  1178. That way it doesn't matter how many files you have on the |nRAMdisk|n.  The
  1179. /E and /X and /A switches are used if you want the |nRAMdisk|n to be placed
  1180.                            <page down> for more
  1181.                              RAMdisk continued
  1182. into extended or expanded memory.  Of course you can only use one of them
  1183. at a time.  The :D parameter that is connected to the /E or /X or /A is
  1184. optional, and it tells DOS how many sectors of data to transfer to and
  1185. from the |nRAMdisk|n at a time.  The D can be from 1 to 8, with 8 as the de-
  1186. fault, and you can pretty much ignore that parameter, just leave it at
  1187. the default, unless the manual for one of your applications tells you
  1188. otherwise.
  1189.  
  1190. Just don't forget if you ever decide to remove the |nRAMdisk|n line from your
  1191. CONFIG.SYS file, that all of the applications you may have configured to
  1192. use the |nRAMdisk|n for their temporary files, will still be looking for the
  1193. |nRAMdisk|n, and that could cause you big problems.  So remember everything
  1194. that you've told to use the |nRAMdisk|n, including |sbatch file|ss, so in case
  1195. you stop using the |nRAMdisk|n you can direct everything back to your hard
  1196. drive again.
  1197.  
  1198. You can use as many RAMdisks as you want at the same time, if you have
  1199. enough |nmemory|n, by repeating the DEVIC|1E command that creates the RAMdisks.
  1200. Each |nRAMdisk|n will get the next higher drive letter than the previous one.
  1201.                            What Is |tShelling Out|t?
  1202.  
  1203. Many applications have a menu choice where you can get to a DOS prompt
  1204. without actually exiting from the application.  Then you can do whatever
  1205. it was that you wanted to do in DOS, and then when you type |nEXIT|n you get
  1206. taken right back to the point where you had been inside your application
  1207. before you went to the DOS |nprompt|n.  This is called "shelling out" to DOS.
  1208.  
  1209. The reason it's called that, is because COMMAND.COM, your command inter-
  1210. preter, is also called a command shell.  When you shell out to DOS from
  1211. within another application, what the application does is load a secondary
  1212. copy of |nCOMMAND.COM|n into memory, and you do your work in that secondary
  1213. shell.
  1214.  
  1215. The |TEXIT|T command causes the secondary command shell to drop out of mem-
  1216. ory, and you find yourself right back where you were before the secondary
  1217. shell had been loaded on top of what you had been doing.
  1218.  
  1219. If you forget that you're in a secondary command processor, and you don't
  1220.                            <page down> for more
  1221.                           Shelling Out continued
  1222. use the EXIT command to get back into the application, and exit the app,
  1223. before you turn the computer off for the day, then not only will your
  1224. work that you'd been doing inside the application not get saved to disk,
  1225. but also you could end up with all sorts of strange files on your disk.
  1226.  
  1227. Many applications make temporary working files on the disk, to keep track
  1228. of things that they're doing that don't all fit in memory.  When you exit
  1229. the application, it automatically cleans up after itself and deletes the
  1230. temp files that it had been using.  If you don't exit the application
  1231. properly before turning off the computer, the application never gets the
  1232. chance to delete those files.
  1233.  
  1234. Also, many applications create yet another temp file on the disk, when
  1235. you shell out to DOS, to remind itself how to get back to where it was,
  1236. whenever you're done in DOS and type the |nEXIT|n command.  When you do type
  1237. |nEXIT|n and go back to the application, the app uses that temp file to find
  1238. its way back, and then it deletes that temp file.  So if you don't ever
  1239. use the |nEXIT|n command to get back to the app, then there's another temp
  1240.                            <page down> for more
  1241.                           Shelling Out continued
  1242. file that stays on your disk.
  1243.  
  1244. An awful lot of beginners (and non-beginners too) have this problem with
  1245. DOS version 4's DOSSHELL.  There are two ways you can get a DOS prompt
  1246. from within the |nDOSSHELL|n.  One way, when it displays the DOS |nprompt|n, it
  1247. also says across the top of the screen, "When ready to return to the DOS
  1248. Shell, type |nEXIT|n then press enter".  If you see that banner across your
  1249. screen, then you know that you have not exited the |nDOSSHELL|n, you have
  1250. only shelled out.  If you turn off the computer at that point, you will
  1251. end up with those funky filenames like 10370F37 (yes, that's a filename)
  1252. on your disk.  You need to type EXIT to get back to the |nDOSSHELL|n, exit
  1253. from the |nDOSSHELL|n in the proper manner, and then turn off the computer.
  1254.  
  1255. You know that you never want to turn off the computer unless you're at
  1256. the DOS |nprompt|n, but you also need to make sure you're at the |nprompt|n for
  1257. the primary command shell, not a secondary one.  That way you won't get
  1258. all those funky numbered filenames all the time, only once in a while
  1259. when your computer locks up and you have no choice but to reboot while
  1260.                            <page down> for more
  1261.                           Shelling Out continued
  1262. you're in an application.  But that can't be helped; it just happens.
  1263.  
  1264. So how do you make sure you're always in the primary command processor,
  1265. instead of a secondary one, before you turn off the computer?  Just type
  1266. |nEXIT|n and hit <Enter>.  If you had been in a secondary shell, that command
  1267. will take you back to whatever you had been doing in the primary shell
  1268. before you shelled out to a secondary one.  But if you're already in the
  1269. primary shell, then the EXIT command won't do a single thing, as long as
  1270. you have followed one rule in your CONFIG.SYS file:  If you have a |nSHELL|n
  1271. statement in that file, it absolutely must have a /P switch at the end of
  1272. it.  If you don't have a |nSHELL|n statement, that's fine, but if you do, it
  1273. has to have the /P switch.
  1274.  
  1275. So if you type |nEXIT|n at the DOS prompt before you turn off your computer,
  1276. it will take you back into whatever application you were running so that
  1277. you can exit it properly, or else if you were in the primary shell, the
  1278. command will have no effect and you'll know that you can turn off your
  1279. computer without leaving any of those funky numbered files laying around.
  1280.                            <page down> for more
  1281.                           Shelling Out continued
  1282. What if you already have some of those funky numbered files on your disk?
  1283. Well, they're probably just temp files from your not properly exiting
  1284. some application, in which case there's no reason not to delete them.
  1285. They're just taking up space on your disk for nothing.  But just in case
  1286. they are something that one of your applications requires, copy them to a
  1287. floppy for safe-keeping, and then after you see that your app still runs
  1288. just fine, then you can delete them from the |nfloppy|n.  If your app doesn't
  1289. run anymore, then you know that one or more of those files was something
  1290. necessary, instead of just a temp file.  So copy them back one by one, to
  1291. figure out which one it is that your app needs, leave that one on your
  1292. disk and just delete the others.
  1293.  
  1294. If you have an application from which you like to shell out a lot, and
  1295. you run that application from a batch file, there is something you can do
  1296. to make it easy for you to remember that you're in a secondary shell
  1297. rather than the primary one.  Suppose the name of this app is WORD and
  1298. the |nbatch file|n from which you run it, is WP.BAT:
  1299.  
  1300.                            <page down> for more
  1301.                           Shelling Out continued
  1302.           @ECHO OFF
  1303.           CD C:\WORD
  1304.           |nPROMPT|n Shelling from WORD--Type |nEXIT|n to return$_$P$G
  1305.           WORD
  1306.           |nPROMPT|n $P$G
  1307.           CD \
  1308. Now every time you run the WORD application by using WP.BAT, your prompt
  1309. will be changed from:
  1310.           C:\WORD>
  1311. to:
  1312.           Shelling from WORD--Type |nEXIT|n to return
  1313.           C:\WORD>
  1314. so that you can't possibly forget that you're in a secondary shell, and
  1315. then after you exit from the WORD application, the batch file puts your
  1316. |nprompt|n back to:
  1317.           C:\WORD>
  1318. before it changes back to the root directory and leaves you in DOS.
  1319.  
  1320.                            <page down> for more
  1321.                           Shelling Out continued
  1322. Or if you're using the DOS version 5.0 DOSSHELL, you can change the prop-
  1323. erties screen of the "Command |nPrompt|n" Main Group menu choice, to make the
  1324. command that it executes look like this:
  1325.   |nPROMPT|n Type |nEXIT|n to Return to Shell$_$P$G ; |nCLS|n ; COMMAND ; |nPROMPT|n $P$G
  1326. so that whenever you use the "Command |nPrompt|n" menu option to shell out to
  1327. DOS, it will remind you that you're in a secondary shell, and it will al-
  1328. so clear the screen for you since the |nDOSSHELL|n will mess up any color you
  1329. had set up using ANSI.SYS, which the CLS command will put back to normal.
  1330.  
  1331. What if you have an application that offers a menu choice of |nshelling out|n
  1332. to DOS, but it never works?  Well most applications use the COMSPEC vari-
  1333. able in the environment to find your copy of COMMAND.COM and load it, but
  1334. there are some poorly-written applications that don't do that.  They look
  1335. in the root directory of the boo|1t disk to find a file named |nCOMMAND.COM|n
  1336. and they load that, without even looking to see what the |nCOMSPEC|n variable
  1337. has to say.  If you have an application that does that, and you really do
  1338. want to be able to shell out from that app, then you will have to just
  1339. leave your |nCOMMAND.COM|n file in the |nroot|n |ndirectory|n, and adjust your SHELL
  1340. statement in CONFIG.SYS accordingly.
  1341.                             The |TFORMAT|T Command
  1342.  
  1343. What on earth is this |nFORMAT|n command that most DOS manuals expect you to
  1344. understand with very little explanation?  The manuals say that it pre-
  1345. pares a disk for use by DOS.  Well what does that mean?  It can be visu-
  1346. alized like the lines on a parking lot.  A person knows how to |npark|n a car
  1347. even when there are no lines at all.  However, DOS isn't that smart.  DOS
  1348. cannot even begin to think about parking a file on a disk, unless it can
  1349. see the lines on the parking lot!  The |nFORMAT|n command is what paints the
  1350. lines there.  That's why a disk can't be used until it's been formatted.
  1351.  
  1352. The only exceptions to this are the DISKCOPY command, which copies the
  1353. entire source disk, including the format, so the target disk need not be
  1354. formatted first, and some versions of BACKUP programs, which can call the
  1355. |nFORMAT|n command to format the disks during the |nBACKUP|n process.
  1356.  
  1357. Don't forget that if there are any files on the disk, the |nFORMAT|n command
  1358. will wipe out all the directory entries for all the files.  Your files
  1359. will basically be gone.  There are hard drive utility packages such as
  1360.                            <page down> for more
  1361.                              FORMAT continued
  1362. Central Point's PC Tools and Symantec's Norton Utilities that can get the
  1363. files back for you, and also in DOS version 5.0 there is an UNFORMAT com-
  1364. mand, but it's a lot easier to just not format a disk, than it is to un-
  1365. format it.  Before you format any disk that's been used before, be sure
  1366. to check the directory to see if there's anything you might want to save.
  1367.  
  1368. Formatting |tfloppy|t disks can get kind of tricky sometimes.  You need to
  1369. understand the differences among all the different types of |nfloppy|n |ndisks|n.
  1370. Right now there are only four types that are the least bit popular.  They
  1371. are 360K, 720K, 1.2M, and 1.44M.
  1372.  
  1373. A 360K disk holds 368,640 bytes of data.  (One K is equal to 1024 |nbytes|n.)
  1374. The physical size of such a disk is 5.25 inches, and the disk is enclosed
  1375. in a really flimsy plastic cover.  Another name for it besides "360K" is
  1376. DSDD or 2S2D which means Double-Sided, Double-Density.
  1377.  
  1378. A 720K disk holds 737,280 |nbytes|n of data.  This type of disk is 3.5 inches
  1379. in size, and it is enclosed in a nice hard sturdy plastic shell.  It can
  1380.                            <page down> for more
  1381.                              FORMAT continued
  1382. also be referred to as a DSDD or 2S2D disk, which is the same thing that
  1383. a 360K disk can be called.  So you have to watch out for what size you're
  1384. buying, as well as what density.
  1385.  
  1386. A 1.2M disk is a DSHD (High-Density) 5.25-inch disk.  It holds 1,258,291
  1387. bytes of data, since a Megabyte is equal to 1024 X 1024 |nbytes|n.  And a
  1388. 1.44M disk is a DSHD 3.5-inch disk which holds 1,509,949 |nbytes|n of data.
  1389.  
  1390. Some manufacturers write things like "2M" on a box of 1.44M disks, or
  1391. "1M" on a box of 720Ks, but they're not giving you any more space than
  1392. the other manufacturers do!  They're just trying to make you think they
  1393. are.  The "2M" means the capacity of the disk before it is formatted!
  1394. When a disk is formatted it gets a |nboot|n record, a FAT, a root directory,
  1395. some sector headers, and things like that so that DOS will be able to
  1396. work with the disk.  Once a "2M" disk has been formatted, it has 1.44M of
  1397. space left for data, just like any other DSHD 3.5-inch disk.  Don't let
  1398. those marketing departments fool you!
  1399.  
  1400.                            <page down> for more
  1401.                              FORMAT continued
  1402. A HD (High Density) disk drive can read and write either HD or DD disks,
  1403. but a DD (Double Density) drive can only use DD |ndisks|n.  In fact, most DD
  1404. drives can't even read a DD disk if it was formatted by a HD drive.  The
  1405. way to transfer data between a HD drive and a DD drive, is by formatting
  1406. the disk that will be used, on the DD drive, then writing to it on the HD
  1407. drive.  Then the DD drive will usually be able to read it.
  1408.  
  1409. You can format a DD disk to its DD capacity in a HD drive, but only if
  1410. you use the correct switches with the |nFORMAT|n command.  Here's where it
  1411. gets complicated.  If you have DOS version 4 or higher, you just say:
  1412.           |nFORMAT|n A: /F:720   or   |nFORMAT|n A: /F:360
  1413. to format the disk to the desired capacity.  But before DOS version 4,
  1414. it was not so easy!
  1415.  
  1416. Under DOS version 3 you can use the command:
  1417.           |nFORMAT|n A: /4
  1418. to format a 360K disk in a 1.2M drive.  But that one won't work to format
  1419. a 720K disk in a 1.44M drive.  For that, you have to use the command:
  1420.                            <page down> for more
  1421.                              FORMAT continued
  1422.           |nFORMAT|n A: /N:9 /T:80
  1423. Of course this only works in DOS version 3.3, since before that, there
  1424. was no such thing as a 1.44M drive anyway.
  1425.  
  1426. Well, that wasn't really so hard after all, was it?  The only hard part
  1427. is memorizing something like /N:9 /T:80.  You can write a batch file that
  1428. will remember those switches for you, and name it 720K.BAT or something.
  1429.  
  1430. It's really a very bad idea to try to format a disk to some capacity oth-
  1431. er than what it was made for.  In some cases it can be done, but even if
  1432. it seems to work, it is not reliable.  The data might sit on such a disk
  1433. for a couple years if you're really lucky, but suddenly it will just dis-
  1434. appear, and of course that will happen right when you need that data the
  1435. most.  So if you want to format a disk to High Density, buy a High Den-
  1436. sity disk.  If you want to format a disk to Double Density, buy a Double
  1437. Density disk.  Of course if you only have a Double Density drive, then
  1438. you don't have to worry about this.  DD disks are the only kind that your
  1439. drive will even try to read.
  1440.                            <page down> for more
  1441.                              FORMAT continued
  1442. If you want to assign a |sVOL|sume label to the disk as soon as it's format-
  1443. ted, you include the /V switch on the command line, and when formatting
  1444. is complete, DOS will ask you what you want the label to be.  With DOS
  1445. version 4, you can include the volume label on the command line, as in
  1446. /V:WHATEVER so that DOS won't ask you at the end, it will just put that
  1447. label on instead.  And in version 5, DOS is going to ask you what the la-
  1448. bel should be whether you use the /V switch or not.  So in version 5, the
  1449. only time you use the /V switch is when you do include the label on the
  1450. command line.
  1451.  
  1452. You can reformat and reuse disks as many times as you want, but there's
  1453. one thing to be careful of.  If you reuse a disk you're probably going to
  1454. want to change the paper label that's on the outside of the disk.  For
  1455. goodness' sake, if it's a 5.25" floppy disk, do not use a hard ballpoint
  1456. pen or a pencil or anything to write on any label that's on the disk.
  1457. Use a felt-tip pen or write on a new label and put the label on the disk
  1458. after you write on it.  And don't ever put a disk in the drive if its
  1459. label is coming loose because it can get stuck and come off in the drive.
  1460.                            <page down> for more
  1461.                              FORMAT continued
  1462. It's perfectly normal to get a few bad sectors when formatting a disk.
  1463. Almost every hard drive in the world has some, and it's not that rare for
  1464. a floppy to have a few.  Sometimes if you reformat the disk, the bad sec-
  1465. tors will be cleared up, sometimes not.  DOS marks the bad sectors off in
  1466. the FAT as if they were already in use, so that your data won't get
  1467. stored there.
  1468.  
  1469. Starting with DOS version 4.0, every disk that gets formatted gets a ser-
  1470. ial number, which is a unique number that the computer picks based on the
  1471. time of the system clock.  This number will be displayed whenever you use
  1472. the DIR or CHKDSK commands, and can be used by some programs which were
  1473. written to be able to use it, to make sure that the correct disk is in
  1474. the drive.  Why?  Well imagine that the program is storing some informa-
  1475. tion in memory and you take a disk out of the drive and put a different
  1476. one in.  Well if the program doesn't notice that you changed disks, and
  1477. it writes that data from |nmemory|n to the disk, it could trash the |nFAT|n of
  1478. that disk.  If the program checks the serial number first, and sees that
  1479. you changed |ndisks|n, then it won't do such a lousy rotten thing.
  1480.                            <page down> for more
  1481.                              FORMAT continued
  1482. The rest of this section is about the changes in DOS version 5.0's FOR-
  1483. MAT command, so if you don't have version 5, don't pay too much attention
  1484. to this or you might get confused about what your version of DOS is cap-
  1485. able of.  Check it out to see what you're missing, though.
  1486.  
  1487. DOS version 5.0's new |nFORMAT|n command does a "safe" format, which means
  1488. that it does the same thing the MIRROR command does, namely it stores a
  1489. copy of the disk's FAT and root directory in a little file named |nMIRROR|n
  1490. .FIL, before it formats the disk.  Then if you realize ten minutes later,
  1491. before you've written any more data to that disk, that it was the wrong
  1492. disk and you didn't mean to format that one, you can use the UNFORMAT
  1493. command to put it back the way it was right before you formatted it.
  1494. This "safe" format is what DOS will use if you don't specify the /U
  1495. switch and if you don't try to reformat a disk to a different capacity
  1496. than that at which it was originally formatted.  (You don't need to have
  1497. the |nMIRROR|n.COM file available to make this work though, because the app-
  1498. licable parts of that command's code are inside the |nFORMAT|n.COM file.)
  1499.  
  1500.                            <page down> for more
  1501.                              FORMAT continued
  1502. The first new switch for the DOS version 5.0 |nFORMAT|n command is /Q.  That
  1503. stands for quick format.  The FAT and root directory are treated just
  1504. like normal, but no surface scanning is done.  Normally the |nFORMAT|n com-
  1505. mand checks for bad sectors on the disk and if any are found, they are
  1506. marked as bad in the |nFAT|n so that DOS will never try to store any of your
  1507. data in those spots.  But |nFORMAT|n /Q skips this step.  Therefore, you
  1508. should never use this switch with a brand new disk, and you should never
  1509. use it on a disk from which you have received any read errors.
  1510.  
  1511. Then there is the /U switch which stands for unconditional, but it would
  1512. really make more sense to think of it as standing for unsafe.  Because
  1513. this switch causes the |nFORMAT|n command to not run the MIRROR program, so a
  1514. disk that's been formatted with the /U switch can't be |sUNFORMAT|sted.  The
  1515. /U switch should always be used for brand new disks, because this'll make
  1516. the process go a lot faster.
  1517.  
  1518. The /F switch is not new to version 5, but one of its parameters is.  You
  1519. can use /F:2.88 to format a 2.88M disk if you have a new disk drive that
  1520. supports that size.
  1521.                      How Does |tMagnetism|t Affect |sDisks|s?
  1522.  
  1523. Well, |nmagnetism|n is what puts the data onto your |ndisks|n.  So obviously any
  1524. magnetic field can change the data that's on a disk.  They make a device
  1525. called a degausser, which is just a strong magnet, to totally and com-
  1526. pletely erase a disk.  (Quite often a disk that just won't FORMAT proper-
  1527. ly can be fixed up by a magnet.  It will erase all traces of any data,
  1528. or even the previous format itself, so that the disk is just as blank as
  1529. when you bought it, and now it will format properly.)  If you need a de-
  1530. gausser and don't have one, a stereo speaker generally works pretty well.
  1531. Just lean your disk up against it and crank up some Judas Priest, and
  1532. your disk ought to get degaussed.
  1533.  
  1534. All right, so obviously you don't want to tack a disk up to the side of
  1535. your filing cabinet with a magnet, but what else do you want to watch out
  1536. for?  Well your monitor is about the worst culprit.  There's a tremendous
  1537. magnetic field in there, and it comes out especially strongly from the
  1538. back and the top.  If you have one of those old phones that has an actual
  1539. bell-like ring, rather than one of the newer electronic beeping rings,
  1540.                            <page down> for more
  1541.                             Magnetism continued
  1542. then your phone gives a pretty decent magnetic field every time it rings.
  1543. Some people say that even the cord running from the phone to the wall,
  1544. and speaker wires, and any sort of electric wire, also give off a magnet-
  1545. ic field.  I don't know if that's true or not, but, better safe than
  1546. sorry, eh?
  1547.  
  1548. Just about anything electrical, especially anything with a motor in it,
  1549. causes a magnetic field.  Yes, that includes your printer and your fluor-
  1550. escent desk lamp.  (Fluorescent lamps do some really strange things to
  1551. your monitor, too, if it's sitting too close.)
  1552.  
  1553. Well gosh, you say, there's electricity everywhere!  How am I supposed to
  1554. keep any data on my |sdisks|s?  Well, it's really not as bad as I've made it
  1555. sound.  All of these things can possibly wipe the data from a disk, but
  1556. it doesn't happen that often.  The disk has to be exposed to the field
  1557. for a while before anything usually happens to the data, depending on the
  1558. strength of the field.  Just don't lean a disk up against the phone, or
  1559. set it on top of the printer, for more than a couple minutes.  Try to
  1560.                            <page down> for more
  1561.                             Magnetism continued
  1562. keep your disks at least a foot away from all the things I've mentioned,
  1563. but you don't necessarily have to panic if you forget and lean a disk
  1564. against your electric stapler.
  1565.  
  1566. Also remember that a pattern of magnetic particles (your data) on a disk
  1567. will tend to fade over time.  The older a disk is, the easier it would be
  1568. for a magnetic field to trash your data, because the pattern of magnetic
  1569. particles has begun to fade.  That's why you ought to refresh all your
  1570. floppies every couple years by using the PC Tools PCFORMAT command with
  1571. the /R switch.  (I would imagine that the Norton Utilities has a similar
  1572. feature as well; I just don't know what it's named.)  This will read each
  1573. track's worth of data into memory, FORMAT that track, and then write the
  1574. data from |nmemory|n back to the floppy disk at full strength.
  1575.  
  1576. This also needs to be done to a hard drive every couple years (unless you
  1577. have one of the new IDE drives which must never be |nLow-Level|n Formatted).
  1578. But the |nFORMAT|n command won't do it.  Because you see, in a hard disk, the
  1579. format is done in two separate steps.  You could think of the |tLow-Level|t
  1580.                            <page down> for more
  1581.                             Magnetism continued
  1582. Format as putting a coat of sealant on the parking lot before the FORMAT
  1583. command paints the lines on the lot.  On floppy disks, the |nFORMAT|n command
  1584. performs both of those steps, but not on a hard disk.
  1585.  
  1586. There are utilities such as SpinRite and one of the features of Norton
  1587. Utilities, that will do a Low-Level Format the same way the /R switch
  1588. of PCFORMAT works--it reads one track of data into memory, formats that
  1589. track, and then writes the data back to the disk.  That means your data
  1590. most likely will not be lost during the |nLow-Level|n Formatting process.
  1591.  
  1592. In general though, a |nLow-Level|n Format will erase every speck of data from
  1593. a disk, so thoroughly that no recovery utility in the world can get it
  1594. back.  So here are the steps to follow to perform a |nLow-Level|n Format:
  1595.           1.  BACKUP
  1596.           2.  |nLow-Level|n Format
  1597.               How, you say?  Well most hard drive controllers have the
  1598. code which performs a |nLow-Level|n Format stored in a ROM chip right there
  1599. on the controller.  You can use DOS's DEBUG command to access it.  The
  1600.                            <page down> for more
  1601.                             Magnetism continued
  1602. instructions and the applicable ROM memory address will be found in the
  1603. literature that came with your drive, or you can contact the dealer or
  1604. the manufacturer.
  1605.           3.  FDISK
  1606.           4.  |nFORMAT|n C: /S
  1607.           5.  Mark out Bad Clusters!
  1608.               The FORMAT command does not always find all the unusable
  1609. clusters!  Before you restore your data from your backup disks, you need
  1610. to run some disk diagnostic utility, such as the Surface Scan option of
  1611. PC Tools DISKFIX, to check the whole drive for bad clusters and mark them
  1612. as "bad" in the FAT so that DOS won't put any of your data in a bad spot.
  1613. The |nFORMAT|n command is supposed to do this for you, but it's not totally
  1614. reliable.  So if you have such a utility, use it at this time!
  1615.           6.  RESTORE
  1616. That's all!  Now you have a nice fresh hard drive with nice fresh data!
  1617. But remember, don't ever do a Low-Level Format if you have an IDE drive,
  1618. and don't ever do it without having a complete |nbackup|n!  Even the non-de-
  1619. structive |nLow-Level|n Formats like SpinRite can goof up once in a while!
  1620.  
  1621.                    How Does |tPower|t Affect Your Computer?
  1622.  
  1623. Well, besides the obvious--that the computer doesn't run without |npower|n--
  1624. there are other things to consider.  (See also Park.)
  1625.  
  1626. One is tied right in to the fact that the computer only runs if it has
  1627. |npower|n.  All the data that's temporarily stored in RAM while the computer
  1628. is working on that data, will be lost totally and completely if you have
  1629. a sudden |npower|n outage.  (See also Shelling Out for more info about things
  1630. that happen if you |sreboot|s--or if a |npower|n outage reboots for you--while
  1631. you're in the middle of an application.)  So you need to save what you're
  1632. working on, to your disk, very often.  That way, if the |npower|n goes out,
  1633. you only lose what you had done since you saved your work ten minutes ago
  1634. instead of losing everything you did since you saved three hours ago.
  1635.  
  1636. Remember that "data in |nRAM|n" includes everything that's sitting on your
  1637. RAMdisk too.  So if you're working on a file from the |nRAMdisk|n, saving it
  1638. back to the |nRAMdisk|n every ten minutes won't help you if the |npower|n goes
  1639. out.  You need to save your work to a real disk, either hard or floppy.
  1640.                            <page down> for more
  1641.                               Power continued
  1642. (Now isn't it just the most appropriate thing in the world, that the
  1643. electricity in my house just now flickered for about a tenth of a second,
  1644. so my computer |sreboot|sed itself.  Luckily the text editor I use has this
  1645. handy <F2> key which saves the document to disk without exiting the edit-
  1646. or.  I had just used that key a moment before the "|npower|n hit", so I only
  1647. lost about two sentences, which I had written since I hit the <F2> key.)
  1648.  
  1649. Another factor that computer users need to worry about is |nPower|n Surges.
  1650. Wouldn't it be nice if the electricity that comes out of the wall were at
  1651. a nice constant 110 volts or whatever it's supposed to be?  But that's
  1652. not the case.  Besides "|npower|n hits", where the voltage goes way down for
  1653. just a second, there are also Surges, where the voltage goes way up for
  1654. a second.  This also can be quite damaging to computers, TVs, and other
  1655. electronic devices.  Especially computers.
  1656.  
  1657. You can buy special |npower|n strips that act as "Surge Suppressors", for
  1658. about $15, but those don't do you very much good.  They're better than
  1659. no surge protection at all, of course, but those cheap ones just don't do
  1660.                            <page down> for more
  1661.                               Power continued
  1662. a very good job!  The ones in the $80 price range really do work pretty
  1663. well.  There are even a couple of companies that guarantee both the Surge
  1664. Suppressor and your equipment that's plugged into it!  If their Suppress-
  1665. or fails and your computer gets trashed, they will pay for all of the re-
  1666. pairs!  Of course, that doesn't help you to replace all the data that was
  1667. on your hard drive.  That's what frequent |sbackup|ss are for!
  1668.  
  1669. (The next paragraph may or may not be true.  It was true a few years ago,
  1670. but I've heard in a couple places that the |npower|n supplies they're putting
  1671. into computers these days take care of this problem all by themselves.  I
  1672. don't know if that's completely true or not, so I'm going to mention it.)
  1673.  
  1674. Ever notice how a light bulb usually burns out right when you turn on the
  1675. switch?  Any time you turn on an electrical device, a sudden shock of
  1676. high voltage goes through every component in the device.  Personally, I
  1677. don't want to subject my computer to that shock any more often than ab-
  1678. solutely necessary!  This is part of the raging debate over whether a
  1679. body should leave his computer on all day long, or whether he should turn
  1680.                            <page down> for more
  1681.                               Power continued
  1682. it off when he's not using it.  Turning it off is not a problem, but
  1683. turning it back on can have some undesirable effects.
  1684.  
  1685. If you live in an area that actually experiences "Winter", you know that
  1686. the potholes in the streets get really bad in the Spring, because of the
  1687. constant expansion/contraction caused by freezing/thawing.  Well you know
  1688. that when your computer is running it gets awfully warm in there!  And
  1689. when it's not running, it cools to room temperature.  All that changing
  1690. of the temperature causes the boards and cables inside the computer's
  1691. case to work their way out of their slots and plugs.  So whenever you
  1692. suspect that you have a bad video card or drive controller, the first
  1693. thing you want to check, before you spend money on a repairman, is to
  1694. open up the case and reseat all the cards and replug all the cables.
  1695.  
  1696. First you want to turn off the |npower|n to the computer, and unplug it from
  1697. the wall.  Now open up the case, and before you touch anything inside,
  1698. plug the |npower|n cord back in so that the computer will be grounded.  Now
  1699. touch the |npower|n supply (the big silver metal box usually in the right
  1700.                            <page down> for more
  1701.                               Power continued
  1702. rear corner) which, since the computer is plugged in, will drain off any
  1703. static charge that your body might be carrying.  Because static electric-
  1704. ity can ruin a RAM chip just like that!  (Static can do a lot of damage
  1705. to lots of parts of your computer, and your floppy disks too.)  Touch the
  1706. |npower|n supply very frequently while you're working, especially if you're
  1707. standing on carpet!  Just push down on all your expansion cards, and un-
  1708. plug and replug all the cables.  Stay away from the motherboard, which is
  1709. a big flat thing laying down in the bottom of the computer.  Put the cov-
  1710. er back on and |npower|n up the computer, and it's very likely that your
  1711. hardware problem has vanished!
  1712.  
  1713. What about lightning?  You want to talk about some |npower|n?  There's more
  1714. electricity in a bolt of lightning than you will see anywhere else, all
  1715. week put together!  If lightning strikes your neighborhood and your com-
  1716. puter is plugged into the wall via either the |npower|n cord, or the phone
  1717. cord leading to your modem, there's a good chance that your whole compu-
  1718. ter will be fried!  If lightning strikes the house next door, your com-
  1719. puter is a goner for sure.  If you hear thunder in the distance, finish
  1720.                            <page down> for more
  1721.                               Power continued
  1722. up what you're doing, shut the computer off, and unplug the |npower|n cord
  1723. and the modem's phone line just as quick as you can.  If you live in an
  1724. area where there are a lot of thunderstorms in the summer, unplug the
  1725. |npower|n cord and the modem line every night when you go to bed, and every
  1726. time you leave the house.  If you go on vacation, unplug even if your
  1727. area doesn't get that many thunderstorms!
  1728.  
  1729. Lightning and |npower|n surges are just about the only reasons I can think of
  1730. for turning the computer off whenever you're not using it.  I leave mine
  1731. on from the time I get up, until the time I go to bed, except for when I
  1732. leave the house.  There are corporations that have a couple hundred com-
  1733. puters and they stay on twenty-four hours a day seven days a week, except
  1734. maybe Christmas vacation, and those computers do just fine.  Some people
  1735. turn their computers off and on several times a day, and they seem to do
  1736. just fine too.  I've got a feeling the reasons for turning it off are
  1737. just about equal to the reasons for leaving it on, and that it's just a
  1738. matter of personal preference.  Read everything in this section, get a
  1739. few more opinions, and then use your best judgement as to how you want to
  1740.                            <page down> for more
  1741.                               Power continued
  1742. do it.  It probably doesn't make much of a difference.
  1743.  
  1744. Oh, yeah, I thought of another reason in favor of turning it off.  The
  1745. whole time the computer is running, the fan is pulling air from your room
  1746. into the computer and across the components to keep things cool in there.
  1747. Well if your air has cigarette smoke or cat hair or dust floating around
  1748. in it, and you leave the computer on all the time, then those foreign
  1749. bodies in your air are going into the computer even more often than is
  1750. necessary.  Then again, I've got a very furry cat and I smoke two packs a
  1751. day, and I've never had any troubles with my computers.
  1752.  
  1753. Regardless of whether you decide to turn yours off or leave it on when
  1754. you're going to be away for a long time, you have to do something about
  1755. the monitor.  As long as the same image sits unchanging on the screen,
  1756. you're risking what they call "burn-in".  (Burning in has another defin-
  1757. ition too, and that is leaving the computer turned on for at least two
  1758. solid days when it's first been put together, because generally computer
  1759. components are most likely to fail very early in their life.  If the com-
  1760.                            <page down> for more
  1761.                               Power continued
  1762. puter is left running and working on something like a battery of diagnos-
  1763. tic tests, for two whole days and nothing fails, that probably means the
  1764. computer is going to be fine for a long time to come.  Your dealer should
  1765. have done this for you before he let you have the machine.)  In this case
  1766. "burn-in" means that the same image being left on the screen for an ex-
  1767. tended period of time can cause that image to burn permanently into the
  1768. screen.  You don't want this to happen, so whenever you walk away from
  1769. the computer for a minute, turn the brightness and contrast knobs all the
  1770. way down.  If they're in the back and really hard to reach, then switch
  1771. off the |npower|n on the monitor.  It's not really good for the monitor to be
  1772. turning it on and off all the time, but it's better than burn-in.  There
  1773. is a much better solution to this, though.  There's a type of TSR called
  1774. a screen-blanker or screen-saver, which monitors your keyboard and every
  1775. time you don't hit any keys for a specified number of minutes, the |nTSR|n
  1776. will just remove everything from the screen or, in some cases, put up a
  1777. pretty pattern of constantly-changing graphics, and then when you want
  1778. your old screen back, you just hit any key and poof!  The screen you were
  1779. working on before the screen-saver kicked in, is right there.  There are
  1780. hundreds of shareware screen-savers available from your local BBS.
  1781.                              The |TXCOPY|T Command
  1782.  
  1783. Oh, what a useful command, if you have DOS version 3.2 or higher!  The
  1784. COPY command reads one file from the source, writes it to the target,
  1785. goes back to the source to read the next file, etc.  But |nXCOPY|n reads as
  1786. many of the source files as can fit into the available RAM, writes them
  1787. to the target, and then goes back to get a bunch more from the source.
  1788. It's so much faster!  And it also has a whole bunch of switches that can
  1789. make it do all sorts of things!  (It can't copy Hidden files, though.)
  1790.  
  1791. Well, here is |nXCOPY|n's syntax:
  1792.           |nXCOPY|n D:\DIR\FILENAME.EXT D:\DIR\ /A /D:DATE /E /M /P /S /V /W
  1793. where D:\DIR\FILENAME.EXT is the files you want to copy, and it can use
  1794. wildcards of course, or if you want to copy all the files in that direc-
  1795. tory, you can just say D:\DIR instead.  The second D:\DIR\ is the drive
  1796. and directory you want to copy the files to.  If you leave that part out,
  1797. |nXCOPY|n will bring the source files to the current |ndirectory|n.  If D:\DIR\
  1798. doesn't exist, |nXCOPY|n will create it, but if you don't include that last
  1799. backslash, |nXCOPY|n will ask you whether you want D:\DIR to be a file or a
  1800.                            <page down> for more
  1801.                               XCOPY continued
  1802. directory.  If you're copying more than one file, then of course you want
  1803. D:\DIR to be a |ndirectory|n, rather than a file.
  1804.  
  1805. The /A switch tells |nXCOPY|n to only copy the files that have their Archive
  1806. attributes turned on.  That means files that have been changed or created
  1807. since the last time a program that resets the A attribute was used.  (All
  1808. BACKUP programs reset the A attribute when they handle files.)  But when
  1809. the /A switch is used, |nXCOPY|n leaves that A attribute turned on when it's
  1810. done.
  1811.  
  1812. The /D:DATE switch tells |nXCOPY|n to only copy the files that were last up-
  1813. dated on or after DATE.  For example |nXCOPY|n C:\SIMPLY A:\ /D:07-05-91 will
  1814. only copy files whose date in the |ndirectory|n listing is 7/5/91 or later.
  1815.  
  1816. The /E switch can only be used if the /S switch is used too, and it tells
  1817. |nXCOPY|n to create directories on the target disk just as they exist on the
  1818. source disk, even if there are no files in that |ndirectory|n on the source.
  1819.  
  1820.                            <page down> for more
  1821.                               XCOPY continued
  1822. The /M switch is just like that /A switch, except that when the /M is
  1823. used, |nXCOPY|n turns off the A attribute for each file it copies!  Oh, how
  1824. useful this is!  Of course it's great for an alternative to the BACKUP
  1825. command, but it has an even better use.  Have you ever tried to copy a
  1826. bunch of files to floppy, and there wasn't enough room on the |nfloppy|n for
  1827. all the files, and the COPY or |nXCOPY|n command just stopped dead in its
  1828. tracks and said "Insufficient disk space"?  Then you had to see what
  1829. files did make it to the |nfloppy|n, and copy each of the rest of the files
  1830. separately.  Didn't you just hate that?  Well you never have to do it
  1831. again.  Here's what you want to do.  First, look and see which files al-
  1832. ready have their A attribute set.  You need to know this, so that you can
  1833. put them back the same way when this is done, so that your |nbackup|n program
  1834. will know which files need to be backed up.  The command |nATTRIB|n *.* /S
  1835. will show you all the files in the current directory and its subdirector-
  1836. ies, and there will be an A to the left of each file that has an A at-
  1837. tribute.  (If you have DOS version 5, then the DIR command with the /A
  1838. switch will do this for you even easier.  Just use |nDIR|n /AA to see the
  1839. files that have an A, or do |nDIR|n /A-A to see the ones that don't.)  Now
  1840.                            <page down> for more
  1841.                               XCOPY continued
  1842. keep track of the results of that command, for later.  Step two is to
  1843. give an A attribute to all the files you want to copy, and take A attrib-
  1844. utes away from files that you don't want to copy.  Use the ATTRIB command
  1845. to do that.  Step three is to issue the |nXCOPY|n command, with the /M switch
  1846. (and /S and /E if you want) and |nXCOPY|n will copy all the files that have A
  1847. attributes, and reset the A attribute for each file that it copies.  Now
  1848. when the disk is full, |nXCOPY|n will stop and say "Insufficient disk space",
  1849. but that's ok.  Just put in a fresh disk and use the <F3> key to issue
  1850. the exact same |nXCOPY|n command again.  Now since the /M switch turned off
  1851. the A attribute for each file that it already copied, |nXCOPY|n will start
  1852. copying right where it left off.  When |nXCOPY|n gives you back your DOS
  1853. prompt without saying "Insufficient disk space", then all your files are
  1854. copied.  Now use the |nATTRIB|n command to put the A |nattributes|n back the way
  1855. they were, and you're all set.  This is not nearly as complicated as it
  1856. sounds from the description, so once you've tried it, next time you'll
  1857. probably remember the whole process without even reading this again.
  1858.  
  1859. The /P switch tells |nXCOPY|n to stop and ask you, before copying each file.
  1860.                            <page down> for more
  1861.                               XCOPY continued
  1862. That's good for in case you want to copy almost all the files in a direc-
  1863. tory, or almost all the files that match a particular wildcard specifica-
  1864. tion, or almost all the files that have a later date than the DATE in the
  1865. /D switch, or almost all of whatever.
  1866.  
  1867. The /S switch makes |nXCOPY|n copy all the files in the specified directory,
  1868. and all the files in all of its subdirectories.  If the subdirectories by
  1869. those names don't already exist as branches off the specified target dir-
  1870. ectory, then |nXCOPY|n will create them, as long as there are files inside
  1871. them.  If you want |nXCOPY|n to create subdirectories that don't have any
  1872. files in them, then you want to use the /E switch along with the /S.
  1873.  
  1874. The /V switch makes |nXCOPY|n do the same worthless sort of verification that
  1875. the VERIFY command does.  Don't bother.  Use the COMP or FC command after
  1876. you make the copy, instead of using this switch.
  1877.  
  1878. And the /W switch makes |nXCOPY|n wait for a keystroke before it starts copy-
  1879. ing.  This is good if your |nXCOPY|n.EXE file is on a floppy disk that is not
  1880.                            <page down> for more
  1881.                               XCOPY continued
  1882. the same disk you want to copy files from.  You put the |nXCOPY|n.EXE disk in
  1883. the drive and issue the command including the /W switch, DOS reads the
  1884. |nXCOPY|n command code into memory, and then you can take out the |nXCOPY|n.EXE
  1885. disk and put in the source disk instead, and then |nXCOPY|n will start read-
  1886. ing the files you want to copy.
  1887.  
  1888. Of course not even the wonderful |nXCOPY|n command can do anything with a
  1889. file that's too big to fit all on one floppy disk.  For that you need the
  1890. BACKUP command, and then you'll need the RESTORE command from the same
  1891. DOS version to be able to read that |nbackup|n file.
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.                       The |tFile Creation Error|t Message
  1902.  
  1903. This message comes when DOS tries to create a file and fails.  This can
  1904. happen for several reasons.  The most common, at least for me, is when
  1905. you try to COPY a file over top of another file, but the target copy has
  1906. its Read-only attribute set.  Well what happens is that first DOS tries
  1907. to copy the new file over the old one, but since the old one is Read-only
  1908. that won't work, so DOS tries to create a new file by that same name.
  1909. But since you can't have more than one file by the same name in one dir-
  1910. ectory, that causes this error.  If this happens to you, use the ATTRIB
  1911. command to remove the Read-only attribute from that target file, and then
  1912. you'll be able to copy over it.  Think about it for a second first though
  1913. because there must be a reason for having had its Read-only attribute set
  1914. in the first place.
  1915.  
  1916. Another thing that can cause this error is if the disk is full, or if the
  1917. root directory is full.  Remember you can only have a limited number of
  1918. files in a |nroot|n |ndirectory|n.  But if you're trying to copy a file to a sub-
  1919. |ndirectory|n, and none of these other reasons pan out, then use the CHKDSK
  1920. command to see if the subdirectory has a problem of some sort.
  1921.                          PLEASE IGNORE THIS PAGE!
  1922. |TSHELL|T|fSIMPLY1|f
  1923. |t". and .."|t|fSIMPLY1|f
  1924. |t286|t|fSIMPLY1|f
  1925. |tANSI.SYS|t|fSIMPLY1|f
  1926. |tATTRIB|t|fSIMPLY1|f
  1927. |tAUTOEXEC.BAT|t|fSIMPLY1|f
  1928. |tAttributes|t|fSIMPLY1|f
  1929. |tBACKUP|t|fSIMPLY1|f
  1930. |tBBS|t|fSIMPLY1|f
  1931. |tCHKDSK|t|fSIMPLY1|f
  1932. |tCMOS|t|fSIMPLY1|f
  1933. |tCOMSPEC|t|fSIMPLY1|f
  1934. |tDISKCOPY|t|fSIMPLY1|f
  1935. |tDirectory|t|fSIMPLY1|f
  1936. |tEnvironment|t|fSIMPLY1|f
  1937. |tExpanded|t|fSIMPLY1|f
  1938. |tExtended|t|fSIMPLY1|f
  1939. |tHIMEM.SYS|t|fSIMPLY1|f
  1940. |tHidden files|t|fSIMPLY1|f
  1941. |tIBMBIO.COM|t|fSIMPLY1|f
  1942. |tIBMDOS.COM|t|fSIMPLY1|f
  1943. |tIO.SYS|t|fSIMPLY1|f
  1944. |tMSDOS.SYS|t|fSIMPLY1|f
  1945. |tMemory|t|fSIMPLY1|f
  1946. |tNon system disk|t|fSIMPLY1|f
  1947. |tRAM|t|fSIMPLY1|f
  1948. |tRMDIR|t|fSIMPLY1|f
  1949. |tROM|t|fSIMPLY1|f
  1950. |tShareware|t|fSIMPLY1|f
  1951. |tbytes|t|fSIMPLY1|f
  1952. |tconventional|t|fSIMPLY1|f
  1953. |tcurrent|t|fSIMPLY1|f
  1954. |tdefault|t|fSIMPLY1|f
  1955. |toverlay|t|fSIMPLY1|f
  1956. |troot|t|fSIMPLY1|f
  1957. |TCLS|T|fSIMPLY3|f
  1958. |TCOMP|T|fSIMPLY3|f
  1959. |TCON|T|fSIMPLY3|f
  1960. |TCOPY|T|fSIMPLY3|f
  1961. |TDEBUG|T|fSIMPLY3|f
  1962. |TDEVIC|1E|T|fSIMPLY3|f
  1963. |TDIR|T|fSIMPLY3|f
  1964. |TNUL|T|fSIMPLY3|f
  1965. |tBad command or filename|t|fSIMPLY3|f
  1966. |tPATH|t|fSIMPLY3|f
  1967. |TECHO|T|fSIMPLY4|f
  1968. |TEDIT|T|fSIMPLY4|f
  1969. |TFC|T|fSIMPLY4|f
  1970. |TFDISK|T|fSIMPLY4|f
  1971. |TLASTDRIVE|T|fSIMPLY4|f
  1972. |tPark|t|fSIMPLY4|f
  1973. |TDOSSHELL|T|fSIMPLY5|f
  1974. |TGWBASIC|T|fSIMPLY5|f
  1975. |TMIRROR|T|fSIMPLY5|f
  1976. |TPOST|T|fSIMPLY5|f
  1977. |TSHARE|T|fSIMPLY5|f
  1978. |TUNFORMAT|T|fSIMPLY5|f
  1979. |TVERIFY|T|fSIMPLY5|f
  1980. |TVOL|T|fSIMPLY5|f
  1981. |tBoot|t|fSIMPLY5|f
  1982. |tCOMMAND.COM|t|fSIMPLY5|f
  1983. |tReboot|t|fSIMPLY5|f
  1984. |tWildcards|t|fSIMPLY5|f
  1985. |TQBASIC|T|fSIMPLY6|f
  1986. |TTYPE|T|fSIMPLY6|f
  1987. |tCONFIG.SYS|t|fSIMPLY6|f
  1988. |tFAT|t|fSIMPLY6|f
  1989. |tKeyboard|t|fSIMPLY6|f
  1990. |tLogical Drives|t|fSIMPLY6|f
  1991. |tRedirection|t|fSIMPLY6|f
  1992. |tTSR|t|fSIMPLY6|f
  1993. |tBatch File|t|fSIMPLY7|f
  1994. |tDevice Driver|t|fSIMPLY3|f
  1995. |tPROMPT|t|fSIMPLY6|f
  1996. |tdecimal|t|fSIMPLY6|f
  1997. |TGOTO|T|fSIMPLY4|f
  1998. |TCTTY|T|fSIMPLY3|f
  1999.